@tyrads.com/tyrads-sdk 2.0.0-beta.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE +11 -11
  2. package/android/build.gradle +117 -117
  3. package/android/gradle.properties +5 -5
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/AndroidManifestNew.xml +2 -2
  6. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -112
  7. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +56 -56
  8. package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +18 -21
  9. package/ios/Tyrads/AcmoConfig.swift +32 -31
  10. package/ios/Tyrads/ApiHeaders.swift +12 -0
  11. package/ios/Tyrads/InitModel.swift +48 -46
  12. package/ios/Tyrads/Tyrads.swift +199 -176
  13. package/ios/TyradsSdk-Bridging-Header.h +2 -2
  14. package/ios/TyradsSdk.mm +14 -11
  15. package/ios/TyradsSdk.swift +47 -27
  16. package/lib/commonjs/acmo/core/marquee.js.map +1 -1
  17. package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
  18. package/lib/commonjs/acmo/core/types/types.d.js.map +1 -1
  19. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  20. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  21. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +3 -5
  22. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  23. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  24. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  25. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +3 -3
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  32. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  33. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  34. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  35. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  36. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +23 -7
  37. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  38. package/lib/commonjs/i18n.js.map +1 -1
  39. package/lib/commonjs/index.js +12 -2
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/module/acmo/core/marquee.js.map +1 -1
  42. package/lib/module/acmo/core/storage/storage.js.map +1 -1
  43. package/lib/module/acmo/core/types/types.d.js.map +1 -1
  44. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  45. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  46. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +3 -5
  47. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  48. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  49. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  50. package/lib/module/acmo/modules/dashboard/components/premium_header.js +3 -3
  51. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  52. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  53. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  54. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  55. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  56. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  57. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  58. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  59. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  60. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  61. package/lib/module/acmo/modules/dashboard/top_offers.js +23 -7
  62. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  63. package/lib/module/i18n.js.map +1 -1
  64. package/lib/module/index.js +12 -2
  65. package/lib/module/index.js.map +1 -1
  66. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  70. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  72. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  74. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  76. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  78. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  80. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  83. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  85. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  86. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  87. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  88. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  89. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  90. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  91. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  92. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  93. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  94. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  95. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  96. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  97. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  98. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  99. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  100. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  101. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  102. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  103. package/lib/typescript/module/src/index.d.ts.map +1 -1
  104. package/package.json +197 -197
  105. package/readme.md +95 -97
  106. package/src/acmo/core/marquee.tsx +61 -61
  107. package/src/acmo/core/storage/storage.ts +27 -27
  108. package/src/acmo/core/types/types.d.ts +93 -93
  109. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +84 -84
  110. package/src/acmo/modules/dashboard/components/custom_card.tsx +30 -30
  111. package/src/acmo/modules/dashboard/components/my_games_button.tsx +39 -39
  112. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +138 -143
  113. package/src/acmo/modules/dashboard/components/premium_header.tsx +80 -80
  114. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +155 -160
  115. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +99 -103
  116. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +41 -45
  117. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -183
  118. package/src/acmo/modules/dashboard/repository.ts +94 -94
  119. package/src/acmo/modules/dashboard/top_offers.tsx +144 -131
  120. package/src/i18n.ts +114 -114
  121. package/src/index.tsx +89 -81
  122. package/tyrads-sdk.podspec +41 -41
package/LICENSE CHANGED
@@ -1,11 +1,11 @@
1
- Copyright 2024 TyrAds
2
-
3
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
-
5
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
-
7
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
-
9
- 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
-
11
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright 2024 TyrAds
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,117 +1,117 @@
1
- buildscript {
2
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
- def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["TyradsSdk_kotlinVersion"]
4
-
5
- repositories {
6
- google()
7
- mavenCentral()
8
- }
9
-
10
- dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
12
- // noinspection DifferentKotlinGradleVersion
13
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
- }
15
- }
16
-
17
- def reactNativeArchitectures() {
18
- def value = rootProject.getProperties().get("reactNativeArchitectures")
19
- return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
20
- }
21
-
22
- def isNewArchitectureEnabled() {
23
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
24
- }
25
-
26
- apply plugin: "com.android.library"
27
- apply plugin: "kotlin-android"
28
-
29
- if (isNewArchitectureEnabled()) {
30
- apply plugin: "com.facebook.react"
31
- }
32
-
33
- def getExtOrDefault(name) {
34
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["TyradsSdk_" + name]
35
- }
36
-
37
- def getExtOrIntegerDefault(name) {
38
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["TyradsSdk_" + name]).toInteger()
39
- }
40
-
41
- def supportsNamespace() {
42
- def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
43
- def major = parsed[0].toInteger()
44
- def minor = parsed[1].toInteger()
45
-
46
- // Namespace support was added in 7.3.0
47
- return (major == 7 && minor >= 3) || major >= 8
48
- }
49
-
50
- android {
51
- if (supportsNamespace()) {
52
- namespace "com.tyradssdk"
53
-
54
- sourceSets {
55
- main {
56
- manifest.srcFile "src/main/AndroidManifestNew.xml"
57
- }
58
- }
59
- }
60
-
61
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
62
-
63
- defaultConfig {
64
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
65
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
66
-
67
- }
68
-
69
- buildTypes {
70
- release {
71
- minifyEnabled false
72
- }
73
- }
74
-
75
- lintOptions {
76
- disable "GradleCompatible"
77
- }
78
-
79
- compileOptions {
80
- sourceCompatibility JavaVersion.VERSION_1_8
81
- targetCompatibility JavaVersion.VERSION_1_8
82
- }
83
-
84
- // buildFeatures {
85
- // compose true
86
- // }
87
-
88
- // composeOptions {
89
- // kotlinCompilerExtensionVersion '1.5.10'
90
- // }
91
- }
92
-
93
- repositories {
94
- mavenCentral()
95
- google()
96
- }
97
-
98
- def kotlin_version = getExtOrDefault("kotlinVersion")
99
-
100
- dependencies {
101
- // For < 0.71, this will be from the local maven repo
102
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
103
- //noinspection GradleDynamicVersion
104
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
105
-
106
- // implementation "androidx.activity:activity-compose:1.7.0"
107
- // implementation "androidx.compose.ui:ui:1.5.0"
108
- // implementation "androidx.compose.material:material:1.5.10"
109
- // implementation "androidx.compose.ui:ui-tooling-preview:1.5.10"
110
- // implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
111
-
112
- implementation "com.facebook.react:react-native:+"
113
- implementation 'com.google.code.gson:gson:+'
114
-
115
- implementation 'com.github.tyrads-com:tyrads-sdk-android:fd619c7f0c'
116
- }
117
-
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["TyradsSdk_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ def reactNativeArchitectures() {
18
+ def value = rootProject.getProperties().get("reactNativeArchitectures")
19
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
20
+ }
21
+
22
+ def isNewArchitectureEnabled() {
23
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
24
+ }
25
+
26
+ apply plugin: "com.android.library"
27
+ apply plugin: "kotlin-android"
28
+
29
+ if (isNewArchitectureEnabled()) {
30
+ apply plugin: "com.facebook.react"
31
+ }
32
+
33
+ def getExtOrDefault(name) {
34
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["TyradsSdk_" + name]
35
+ }
36
+
37
+ def getExtOrIntegerDefault(name) {
38
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["TyradsSdk_" + name]).toInteger()
39
+ }
40
+
41
+ def supportsNamespace() {
42
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
43
+ def major = parsed[0].toInteger()
44
+ def minor = parsed[1].toInteger()
45
+
46
+ // Namespace support was added in 7.3.0
47
+ return (major == 7 && minor >= 3) || major >= 8
48
+ }
49
+
50
+ android {
51
+ if (supportsNamespace()) {
52
+ namespace "com.tyradssdk"
53
+
54
+ sourceSets {
55
+ main {
56
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
57
+ }
58
+ }
59
+ }
60
+
61
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
62
+
63
+ defaultConfig {
64
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
65
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
66
+
67
+ }
68
+
69
+ buildTypes {
70
+ release {
71
+ minifyEnabled false
72
+ }
73
+ }
74
+
75
+ lintOptions {
76
+ disable "GradleCompatible"
77
+ }
78
+
79
+ compileOptions {
80
+ sourceCompatibility JavaVersion.VERSION_1_8
81
+ targetCompatibility JavaVersion.VERSION_1_8
82
+ }
83
+
84
+ buildFeatures {
85
+ compose true
86
+ }
87
+
88
+ composeOptions {
89
+ kotlinCompilerExtensionVersion '1.5.10'
90
+ }
91
+ }
92
+
93
+ repositories {
94
+ mavenCentral()
95
+ google()
96
+ }
97
+
98
+ def kotlin_version = getExtOrDefault("kotlinVersion")
99
+
100
+ dependencies {
101
+ // For < 0.71, this will be from the local maven repo
102
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
103
+ //noinspection GradleDynamicVersion
104
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
105
+
106
+ implementation "androidx.activity:activity-compose:1.7.0"
107
+ implementation "androidx.compose.ui:ui:1.5.0"
108
+ implementation "androidx.compose.material:material:1.5.10"
109
+ implementation "androidx.compose.ui:ui-tooling-preview:1.5.10"
110
+ implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
111
+
112
+ implementation "com.facebook.react:react-native:+"
113
+ implementation 'com.google.code.gson:gson:2.10.1'
114
+
115
+ implementation 'com.github.tyrads-com:tyrads-sdk-android:fd619c7f0c'
116
+ }
117
+
@@ -1,5 +1,5 @@
1
- TyradsSdk_kotlinVersion=1.7.0
2
- TyradsSdk_minSdkVersion=24
3
- TyradsSdk_targetSdkVersion=31
4
- TyradsSdk_compileSdkVersion=31
5
- TyradsSdk_ndkversion=21.4.7075529
1
+ TyradsSdk_kotlinVersion=1.7.0
2
+ TyradsSdk_minSdkVersion=24
3
+ TyradsSdk_targetSdkVersion=31
4
+ TyradsSdk_compileSdkVersion=31
5
+ TyradsSdk_ndkversion=21.4.7075529
@@ -1,3 +1,3 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.tyradssdk">
3
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.tyradssdk">
3
+ </manifest>
@@ -1,2 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -1,112 +1,112 @@
1
- // package com.tyradssdk
2
-
3
- // import android.content.Context
4
- // import androidx.compose.runtime.Composable
5
- // import androidx.compose.ui.platform.ComposeView
6
- // import com.facebook.react.bridge.ReactContext
7
- // import com.facebook.react.uimanager.SimpleViewManager
8
- // import com.facebook.react.uimanager.ThemedReactContext
9
- // import com.facebook.react.uimanager.annotations.ReactProp
10
- // import com.tyrads.sdk.Tyrads
11
- // import android.util.Log
12
- // import androidx.compose.foundation.background
13
- // import androidx.compose.foundation.layout.Box
14
- // import androidx.compose.foundation.layout.fillMaxSize
15
- // import androidx.compose.material.Text
16
- // import androidx.compose.ui.Alignment
17
- // import androidx.compose.ui.Modifier
18
- // import androidx.compose.ui.graphics.Color
19
- // import androidx.compose.runtime.LaunchedEffect
20
- // import android.os.Handler
21
- // import android.os.Looper
22
-
23
- // class ComposeViewManager : SimpleViewManager<ComposeView>() {
24
- // override fun getName(): String {
25
- // return "TyradsSdkComposeView"
26
- // }
27
-
28
- // override fun createViewInstance(reactContext: ThemedReactContext): ComposeView {
29
- // Log.d("bmd", "ComposeView created")
30
-
31
- // val composeView = ComposeView(reactContext)
32
-
33
- // Handler(Looper.getMainLooper()).post {
34
- // Log.d("bmd", "Running setContent inside createViewInstance")
35
-
36
- // composeView.setContent {
37
- // Box(
38
- // modifier = Modifier
39
- // .fillMaxSize()
40
- // .background(Color.Yellow),
41
- // contentAlignment = Alignment.Center
42
- // ) {
43
- // Text("Test Compose", color = Color.Black)
44
- // }
45
- // }
46
- // }
47
-
48
- // return composeView
49
- // }
50
-
51
- // @ReactProp(name = "showMore")
52
- // fun setShowMore(view: ComposeView, showMore: Boolean) {
53
- // view.post {
54
- // view.setContent {
55
- // TopPremiumOffersComposable(showMore = showMore)
56
- // }
57
- // }
58
- // }
59
-
60
- // @ReactProp(name = "showMyOffers")
61
- // fun setShowMyOffers(view: ComposeView, showMyOffers: Boolean) {
62
- // view.post{
63
- // view.setContent {
64
- // TopPremiumOffersComposable(showMyOffers = showMyOffers)
65
- // }
66
- // }
67
- // }
68
-
69
- // @ReactProp(name = "showMyOffersEmptyView")
70
- // fun setShowMyOffersEmptyView(view: ComposeView, showMyOffersEmptyView: Boolean) {
71
- // view.post{
72
- // view.setContent {
73
- // TopPremiumOffersComposable(showMyOffersEmptyView = showMyOffersEmptyView)
74
- // }
75
- // }
76
- // }
77
-
78
- // @ReactProp(name = "viewStyle")
79
- // fun setViewStyle(view: ComposeView, viewStyle: Int) {
80
- // view.post{
81
- // view.setContent {
82
- // TopPremiumOffersComposable(style = viewStyle)
83
- // }
84
- // }
85
- // }
86
-
87
- // @Composable
88
- // private fun TopPremiumOffersComposable(
89
- // showMore: Boolean = true,
90
- // showMyOffers: Boolean = true,
91
- // showMyOffersEmptyView: Boolean = false,
92
- // style: Int = 2
93
- // ) {
94
- // LaunchedEffect(Unit){
95
- // Log.d("bmd", "TopPremiumOffersComposable called")
96
- // }
97
- // Box(
98
- // modifier = Modifier
99
- // .fillMaxSize()
100
- // .background(Color.Yellow),
101
- // contentAlignment = Alignment.Center
102
- // ) {
103
- // Text("Test Compose", color = Color.Black)
104
- // }
105
- // // Tyrads.getInstance().TopPremiumOffers(
106
- // // showMore = showMore,
107
- // // showMyOffers = showMyOffers,
108
- // // showMyOffersEmptyView = showMyOffersEmptyView,
109
- // // style = style
110
- // // )
111
- // }
112
- // }
1
+ package com.tyradssdk
2
+
3
+ import android.content.Context
4
+ import androidx.compose.runtime.Composable
5
+ import androidx.compose.ui.platform.ComposeView
6
+ import com.facebook.react.bridge.ReactContext
7
+ import com.facebook.react.uimanager.SimpleViewManager
8
+ import com.facebook.react.uimanager.ThemedReactContext
9
+ import com.facebook.react.uimanager.annotations.ReactProp
10
+ import com.tyrads.sdk.Tyrads
11
+ import android.util.Log
12
+ import androidx.compose.foundation.background
13
+ import androidx.compose.foundation.layout.Box
14
+ import androidx.compose.foundation.layout.fillMaxSize
15
+ import androidx.compose.material.Text
16
+ import androidx.compose.ui.Alignment
17
+ import androidx.compose.ui.Modifier
18
+ import androidx.compose.ui.graphics.Color
19
+ import androidx.compose.runtime.LaunchedEffect
20
+ import android.os.Handler
21
+ import android.os.Looper
22
+
23
+ class ComposeViewManager : SimpleViewManager<ComposeView>() {
24
+ override fun getName(): String {
25
+ return "TyradsSdkComposeView"
26
+ }
27
+
28
+ override fun createViewInstance(reactContext: ThemedReactContext): ComposeView {
29
+ Log.d("bmd", "ComposeView created")
30
+
31
+ val composeView = ComposeView(reactContext)
32
+
33
+ Handler(Looper.getMainLooper()).post {
34
+ Log.d("bmd", "Running setContent inside createViewInstance")
35
+
36
+ composeView.setContent {
37
+ Box(
38
+ modifier = Modifier
39
+ .fillMaxSize()
40
+ .background(Color.Yellow),
41
+ contentAlignment = Alignment.Center
42
+ ) {
43
+ Text("Test Compose", color = Color.Black)
44
+ }
45
+ }
46
+ }
47
+
48
+ return composeView
49
+ }
50
+
51
+ @ReactProp(name = "showMore")
52
+ fun setShowMore(view: ComposeView, showMore: Boolean) {
53
+ view.post {
54
+ view.setContent {
55
+ TopPremiumOffersComposable(showMore = showMore)
56
+ }
57
+ }
58
+ }
59
+
60
+ @ReactProp(name = "showMyOffers")
61
+ fun setShowMyOffers(view: ComposeView, showMyOffers: Boolean) {
62
+ view.post{
63
+ view.setContent {
64
+ TopPremiumOffersComposable(showMyOffers = showMyOffers)
65
+ }
66
+ }
67
+ }
68
+
69
+ @ReactProp(name = "showMyOffersEmptyView")
70
+ fun setShowMyOffersEmptyView(view: ComposeView, showMyOffersEmptyView: Boolean) {
71
+ view.post{
72
+ view.setContent {
73
+ TopPremiumOffersComposable(showMyOffersEmptyView = showMyOffersEmptyView)
74
+ }
75
+ }
76
+ }
77
+
78
+ @ReactProp(name = "viewStyle")
79
+ fun setViewStyle(view: ComposeView, viewStyle: Int) {
80
+ view.post{
81
+ view.setContent {
82
+ TopPremiumOffersComposable(style = viewStyle)
83
+ }
84
+ }
85
+ }
86
+
87
+ @Composable
88
+ private fun TopPremiumOffersComposable(
89
+ showMore: Boolean = true,
90
+ showMyOffers: Boolean = true,
91
+ showMyOffersEmptyView: Boolean = false,
92
+ style: Int = 2
93
+ ) {
94
+ LaunchedEffect(Unit){
95
+ Log.d("bmd", "TopPremiumOffersComposable called")
96
+ }
97
+ Box(
98
+ modifier = Modifier
99
+ .fillMaxSize()
100
+ .background(Color.Yellow),
101
+ contentAlignment = Alignment.Center
102
+ ) {
103
+ Text("Test Compose", color = Color.Black)
104
+ }
105
+ // Tyrads.getInstance().TopPremiumOffers(
106
+ // showMore = showMore,
107
+ // showMyOffers = showMyOffers,
108
+ // showMyOffersEmptyView = showMyOffersEmptyView,
109
+ // style = style
110
+ // )
111
+ }
112
+ }
@@ -1,56 +1,56 @@
1
- package com.tyradssdk
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext
4
- import com.facebook.react.bridge.ReactContextBaseJavaModule
5
- import com.facebook.react.bridge.ReactMethod
6
- import com.facebook.react.bridge.Promise
7
- import kotlinx.coroutines.CoroutineScope
8
- import kotlinx.coroutines.Dispatchers
9
- import kotlinx.coroutines.launch
10
- import com.google.gson.Gson
11
- import android.util.Log
12
- import com.tyrads.sdk.Tyrads
13
-
14
- class TyradsSdkModule(reactContext: ReactApplicationContext) :
15
- ReactContextBaseJavaModule(reactContext) {
16
-
17
- override fun getName(): String {
18
- return NAME
19
- }
20
-
21
- @ReactMethod
22
- fun init(apiKey: String, apiSecret: String, promise: Promise) {
23
- try {
24
- Tyrads.getInstance().init(this.reactApplicationContext, apiKey, apiSecret)
25
- promise.resolve(null)
26
- } catch (e: Exception) {
27
- promise.reject("INIT_ERROR", e.message)
28
- }
29
- }
30
-
31
- @ReactMethod
32
- fun loginUser(userId: String, promise: Promise) {
33
- Tyrads.getInstance().tyradScope.launch {
34
- try {
35
- val apiHeaders = Tyrads.getInstance().loginUser(userId)
36
- Log.i("bmd", "apiHeaders: $apiHeaders")
37
- if (apiHeaders != null) {
38
- val jsonString = Gson().toJson(apiHeaders)
39
- promise.resolve(jsonString)
40
- } else {
41
- promise.resolve(null)
42
- }
43
- } catch (e: Exception) {
44
- promise.reject("LOGIN_ERROR", e.message)
45
- }
46
- }
47
- }
48
- @ReactMethod
49
- fun showOffers(route: String? = null, campaignID: Int? = null) {
50
- Tyrads.getInstance().showOffers(route = route, campaignID = campaignID)
51
- }
52
-
53
- companion object {
54
- const val NAME = "TyradsSdk"
55
- }
56
- }
1
+ package com.tyradssdk
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
5
+ import com.facebook.react.bridge.ReactMethod
6
+ import com.facebook.react.bridge.Promise
7
+ import kotlinx.coroutines.CoroutineScope
8
+ import kotlinx.coroutines.Dispatchers
9
+ import kotlinx.coroutines.launch
10
+ import com.google.gson.Gson
11
+ import android.util.Log
12
+ import com.tyrads.sdk.Tyrads
13
+
14
+ class TyradsSdkModule(reactContext: ReactApplicationContext) :
15
+ ReactContextBaseJavaModule(reactContext) {
16
+
17
+ override fun getName(): String {
18
+ return NAME
19
+ }
20
+
21
+ @ReactMethod
22
+ fun init(apiKey: String, apiSecret: String, promise: Promise) {
23
+ try {
24
+ Tyrads.getInstance().init(this.reactApplicationContext, apiKey, apiSecret)
25
+ promise.resolve(null)
26
+ } catch (e: Exception) {
27
+ promise.reject("INIT_ERROR", e.message)
28
+ }
29
+ }
30
+
31
+ @ReactMethod
32
+ fun loginUser(userId: String, promise: Promise) {
33
+ Tyrads.getInstance().tyradScope.launch {
34
+ try {
35
+ val apiHeaders = Tyrads.getInstance().loginUser(userId)
36
+ Log.i("bmd", "apiHeaders: $apiHeaders")
37
+ if (apiHeaders != null) {
38
+ val jsonString = Gson().toJson(apiHeaders)
39
+ promise.resolve(jsonString)
40
+ } else {
41
+ promise.resolve(null)
42
+ }
43
+ } catch (e: Exception) {
44
+ promise.reject("LOGIN_ERROR", e.message)
45
+ }
46
+ }
47
+ }
48
+ @ReactMethod
49
+ fun showOffers(route: String? = null, campaignID: Int? = null) {
50
+ Tyrads.getInstance().showOffers(route = route, campaignID = campaignID)
51
+ }
52
+
53
+ companion object {
54
+ const val NAME = "TyradsSdk"
55
+ }
56
+ }