@tyrads.com/tyrads-sdk 3.0.0-beta.0 → 3.1.0-beta.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 (225) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +21 -4
  3. package/ios/Tyrads/InitModel.swift +3 -0
  4. package/ios/Tyrads/Tyrads.swift +106 -191
  5. package/ios/Tyrads/WebViewController.swift +171 -0
  6. package/ios/Tyrads/helpers/device_details.swift +58 -0
  7. package/ios/TyradsSdk.mm +7 -1
  8. package/ios/TyradsSdk.swift +42 -27
  9. package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
  10. package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
  11. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +76 -0
  12. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  13. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
  14. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  15. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
  16. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  17. package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
  18. package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  19. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +264 -0
  20. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  21. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +197 -0
  22. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  23. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +83 -0
  24. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  25. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +12 -10
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +118 -0
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  29. package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
  30. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  31. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +70 -63
  32. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  33. package/lib/commonjs/assets/images/angle_up.png +0 -0
  34. package/lib/commonjs/assets/images/diamond.png +0 -0
  35. package/lib/commonjs/assets/images/info.png +0 -0
  36. package/lib/commonjs/assets/images/info_icon.png +0 -0
  37. package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
  38. package/lib/commonjs/assets/images/rank_1.png +0 -0
  39. package/lib/commonjs/assets/images/rank_2.png +0 -0
  40. package/lib/commonjs/assets/images/rank_3.png +0 -0
  41. package/lib/commonjs/assets/images/rank_4.png +0 -0
  42. package/lib/commonjs/assets/images/rank_5.png +0 -0
  43. package/lib/commonjs/index.js +11 -11
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/module/acmo/core/helpers/launcher.js +15 -0
  46. package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
  47. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +70 -0
  48. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  49. package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
  50. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  51. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
  52. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  53. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
  54. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  55. package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
  56. package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  57. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +191 -0
  58. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  59. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +78 -0
  60. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  61. package/lib/module/acmo/modules/dashboard/components/premium_header.js +12 -10
  62. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  63. package/lib/module/acmo/modules/dashboard/components/premium_loading.js +113 -0
  64. package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  65. package/lib/module/acmo/modules/dashboard/repository.js +105 -30
  66. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  67. package/lib/module/acmo/modules/dashboard/top_offers.js +71 -64
  68. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  69. package/lib/module/assets/images/angle_up.png +0 -0
  70. package/lib/module/assets/images/diamond.png +0 -0
  71. package/lib/module/assets/images/info.png +0 -0
  72. package/lib/module/assets/images/info_icon.png +0 -0
  73. package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
  74. package/lib/module/assets/images/rank_1.png +0 -0
  75. package/lib/module/assets/images/rank_2.png +0 -0
  76. package/lib/module/assets/images/rank_3.png +0 -0
  77. package/lib/module/assets/images/rank_4.png +0 -0
  78. package/lib/module/assets/images/rank_5.png +0 -0
  79. package/lib/module/index.js +11 -11
  80. package/lib/module/index.js.map +1 -1
  81. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
  82. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  85. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  88. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  90. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  92. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  94. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  96. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  97. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  98. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
  100. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  102. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/src/index.d.ts +4 -6
  104. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  105. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
  106. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  107. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  108. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  109. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  110. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  111. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  112. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  113. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  114. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  115. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  116. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  117. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  118. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  119. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  120. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  121. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  122. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  123. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
  124. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  125. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  126. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  127. package/lib/typescript/module/src/index.d.ts +4 -6
  128. package/lib/typescript/module/src/index.d.ts.map +1 -1
  129. package/package.json +3 -2
  130. package/readme.md +8 -8
  131. package/src/acmo/core/helpers/launcher.ts +14 -0
  132. package/src/acmo/core/types/types.d.ts +11 -13
  133. package/src/acmo/modules/dashboard/components/active_offers_button.tsx +61 -0
  134. package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
  135. package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
  136. package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
  137. package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
  138. package/src/acmo/modules/dashboard/components/offer_list_item.tsx +225 -0
  139. package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +76 -0
  140. package/src/acmo/modules/dashboard/components/premium_header.tsx +8 -8
  141. package/src/acmo/modules/dashboard/components/premium_loading.tsx +78 -0
  142. package/src/acmo/modules/dashboard/repository.ts +121 -46
  143. package/src/acmo/modules/dashboard/top_offers.tsx +89 -52
  144. package/src/assets/images/angle_up.png +0 -0
  145. package/src/assets/images/diamond.png +0 -0
  146. package/src/assets/images/info.png +0 -0
  147. package/src/assets/images/info_icon.png +0 -0
  148. package/src/assets/images/premium-emptybg.jpeg +0 -0
  149. package/src/assets/images/rank_1.png +0 -0
  150. package/src/assets/images/rank_2.png +0 -0
  151. package/src/assets/images/rank_3.png +0 -0
  152. package/src/assets/images/rank_4.png +0 -0
  153. package/src/assets/images/rank_5.png +0 -0
  154. package/src/index.tsx +15 -18
  155. package/lib/commonjs/acmo/core/marquee.js.map +0 -1
  156. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
  157. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  158. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
  159. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  160. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
  161. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  162. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -180
  163. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  164. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
  165. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  166. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
  167. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  168. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
  169. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  170. package/lib/module/acmo/core/marquee.js +0 -54
  171. package/lib/module/acmo/core/marquee.js.map +0 -1
  172. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
  173. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  174. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
  175. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  176. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
  177. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  178. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -174
  179. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  180. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
  181. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  182. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
  183. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  184. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
  185. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  186. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
  187. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
  188. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  189. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  190. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  191. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  193. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  195. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  197. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  199. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  201. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  202. package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
  203. package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
  204. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  205. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  206. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  207. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  208. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  209. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  210. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  211. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  212. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  213. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  214. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  215. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  216. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  217. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  218. package/src/acmo/core/marquee.tsx +0 -62
  219. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
  220. package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
  221. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
  222. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -163
  223. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
  224. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
  225. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet, ImageBackground } from 'react-native';
3
+
4
+ const PremiumEmptyView: React.FC<{ onContinue?: () => void, colorPremium?: string}> = ({ onContinue, colorPremium}) => {
5
+
6
+ return (
7
+ <View style={styles.container}>
8
+ <ImageBackground
9
+ source={require('../../../../assets/images/premium-emptybg.jpeg')}
10
+ style={styles.backgroundImage}
11
+ imageStyle={styles.imageBorderRadius}
12
+ >
13
+ <View style={styles.content}>
14
+ <Text style={[styles.title, { color: 'white', fontFamily: 'Poppins_600SemiBold' }]}>
15
+ {'Keep Playing!\nExciting Rewards Await!'}
16
+ </Text>
17
+ <TouchableOpacity
18
+ style={[styles.button, { backgroundColor: 'white' }]}
19
+ onPress={onContinue}
20
+ activeOpacity={0.8}
21
+ >
22
+ <Text
23
+ style={[
24
+ styles.buttonText,
25
+ {
26
+ color: colorPremium ?? '#1C90DF',
27
+ fontWeight: 'bold',
28
+ fontSize: 12,
29
+ },
30
+ ]}
31
+ >
32
+ Continue Playing
33
+ </Text>
34
+ </TouchableOpacity>
35
+ </View>
36
+ </ImageBackground>
37
+ </View>
38
+ );
39
+ };
40
+
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ width: '100%',
44
+ },
45
+ backgroundImage: {
46
+ width: '100%',
47
+ borderRadius: 16,
48
+ overflow: 'hidden',
49
+ },
50
+ imageBorderRadius: {
51
+ borderRadius: 16,
52
+ },
53
+ content: {
54
+ paddingVertical: 22,
55
+ paddingHorizontal: 30,
56
+ justifyContent: 'center',
57
+ alignItems: 'center',
58
+ },
59
+ title: {
60
+ textAlign: 'center',
61
+ fontWeight: '600',
62
+ marginBottom: 16,
63
+ },
64
+ button: {
65
+ minWidth: '100%',
66
+ height: 34,
67
+ borderRadius: 8,
68
+ justifyContent: 'center',
69
+ alignItems: 'center',
70
+ },
71
+ buttonText: {
72
+ fontWeight: '600',
73
+ },
74
+ });
75
+
76
+ export default PremiumEmptyView;
@@ -13,13 +13,13 @@ const PremiumHeaderSection: React.FC<PremiumHeaderSectionProps> = ({ showMore =
13
13
  return (
14
14
  <View style={styles.headerContainer}>
15
15
  <View style={styles.leftContainer}>
16
- <View style={[styles.starContainer, { backgroundColor: premiumColor || '#1C90DF' }]}>
16
+ <View style={styles.starContainer}>
17
17
  <Image
18
- source={require('../../../../assets/images/star_pointed.png')}
19
- style={[styles.starIcon, { tintColor: 'white' }]}
18
+ source={require('../../../../assets/images/diamond.png')}
19
+ style={[styles.starIcon, { tintColor: premiumColor }]}
20
20
  />
21
21
  </View>
22
- <Text style={styles.headerText} numberOfLines={1} adjustsFontSizeToFit ellipsizeMode="tail">
22
+ <Text style={[styles.headerText, { color: premiumColor }]} numberOfLines={1} ellipsizeMode="tail">
23
23
  {t('dashboard.suggested_offers')}
24
24
  </Text>
25
25
  </View>
@@ -29,8 +29,8 @@ const PremiumHeaderSection: React.FC<PremiumHeaderSectionProps> = ({ showMore =
29
29
  {t('dashboard.more_offers')}
30
30
  </Text>
31
31
  <Image
32
- source={require('../../../../assets/images/right_arrow.png')}
33
- style={{ width: 11, height: 11, objectFit: 'contain', marginLeft: 5, tintColor: premiumColor || "#1C90DF" }}
32
+ source={require('../../../../assets/images/angle_up.png')}
33
+ style={{ transform: [{ rotate: '90deg' }], width: 11, height: 11, objectFit: 'contain', marginLeft: 5, tintColor: premiumColor || "#1C90DF" }}
34
34
  />
35
35
  </TouchableOpacity>
36
36
  )}
@@ -51,7 +51,7 @@ const styles = StyleSheet.create({
51
51
  justifyContent: 'space-between',
52
52
  alignItems: 'center',
53
53
  paddingHorizontal: 16,
54
- paddingVertical: 6,
54
+ paddingTop: 10,
55
55
  },
56
56
  leftContainer: {
57
57
  flexDirection: 'row',
@@ -64,7 +64,7 @@ const styles = StyleSheet.create({
64
64
  },
65
65
  headerText: {
66
66
  marginLeft: 8,
67
- fontSize: 16,
67
+ fontSize: 14,
68
68
  fontWeight: 'bold',
69
69
  flex: 1,
70
70
  },
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import Shimmer from './custom_shimmer';
4
+ import { PremiumWidgetStyles } from '../top_offers';
5
+ import CustomCard from './custom_card';
6
+
7
+ interface PremiumWidgetsLoadingProps {
8
+ widgetStyle: PremiumWidgetStyles;
9
+ itemHeight?: number;
10
+ }
11
+
12
+ const PremiumWidgetsLoading: React.FC<PremiumWidgetsLoadingProps> = ({
13
+ widgetStyle,
14
+ itemHeight,
15
+ }) => {
16
+ return (
17
+ <CustomCard style={{
18
+ width: '100%',
19
+ paddingHorizontal: 16,
20
+ }}>
21
+ <View style={styles.headerRow}>
22
+ <Shimmer style={{ width: 120, height: 18, borderRadius: 4 }} />
23
+ <Shimmer style={{ width: 105, height: 18, borderRadius: 4 }} />
24
+ </View>
25
+
26
+ {widgetStyle === PremiumWidgetStyles.list ? (
27
+ <View style={styles.listContainer}>
28
+ {[...Array(4)].map((_, index) => (
29
+ <View key={index} style={styles.listTile}>
30
+ <Shimmer shimmerHeight={54} style={{ width: 54, height: 54, borderRadius: 4 }} />
31
+
32
+ <View style={styles.titleColumn}>
33
+ <Shimmer style={{ width: 130, height: 16, marginBottom: 2 }} />
34
+ <Shimmer style={{ width: 65, height: 16 }} />
35
+ </View>
36
+
37
+ <Shimmer shimmerHeight={42} style={{ width: 80, height: 42, borderRadius: 8 }} />
38
+ </View>
39
+ ))}
40
+ </View>
41
+ ) : (
42
+ <>
43
+ <Shimmer style={{ width: '100%', height: itemHeight }} />
44
+ </>
45
+ )}
46
+
47
+ {widgetStyle === PremiumWidgetStyles.sliderCards && (
48
+ <Shimmer shimmerHeight={150} style={{ flexDirection: 'row', height: 150, }} />
49
+ )}
50
+
51
+ <Shimmer shimmerHeight={42} style={{ flexDirection: 'row', height: 42, borderRadius: 21, marginVertical: 16 }} />
52
+ </CustomCard>
53
+ );
54
+ };
55
+
56
+ const styles = StyleSheet.create({
57
+ headerRow: {
58
+ flexDirection: 'row',
59
+ justifyContent: 'space-between',
60
+ marginTop: 12,
61
+ },
62
+ listContainer: {
63
+ marginTop: 12,
64
+ },
65
+ listTile: {
66
+ flexDirection: 'row',
67
+ alignItems: 'center',
68
+ paddingVertical: 10,
69
+ justifyContent: 'space-between',
70
+ },
71
+ titleColumn: {
72
+ flexDirection: 'column',
73
+ justifyContent: 'center',
74
+ marginHorizontal: 16,
75
+ },
76
+ });
77
+
78
+ export default PremiumWidgetsLoading;
@@ -1,5 +1,6 @@
1
- import axios, { type AxiosResponse } from 'axios';
1
+ import axios from 'axios';
2
2
  import { getData } from '../../core/storage/storage';
3
+ import { acmoLaunchURLForce } from '../../core/helpers/launcher';
3
4
 
4
5
  interface ApiHeaders {
5
6
  languageCode: string;
@@ -12,28 +13,11 @@ interface ApiHeaders {
12
13
  userAgent: string;
13
14
  }
14
15
 
15
- const transformCampaigns = (campaigns: Campaign[]): TransformedCampaign[] => {
16
- return campaigns.map((campaign) => ({
17
- campaignId: campaign.campaignId || 0,
18
- appId: campaign.app?.id || 0,
19
- title: campaign.app?.title || 'Unknown Title',
20
- creativePackName:
21
- campaign.creative?.creativePacks?.[0]?.creativePackName || '',
22
- fileUrl:
23
- campaign.creative?.creativePacks?.[0]?.creatives?.[0]?.fileUrl || '',
24
- points: campaign.campaignPayout?.totalPayoutConverted || 0,
25
- rewards: campaign.campaignPayout?.totalEvents || 0,
26
- currency: campaign.currency || {},
27
- thumbnail: campaign.app?.thumbnail || '',
28
- premium: campaign.premium || false,
29
- sortingScore: campaign.sortingScore || 0,
30
- }));
31
- };
32
-
33
- export const fetchCampaignsData = async (
34
- // setLanguage: (language: string) => void,
16
+ export const fetchPremiumOfferDetails = async (
35
17
  setPremiumColor: (color: string) => void,
36
- setCampaigns: (campaigns: TransformedCampaign[]) => void,
18
+ setCampaigns: (campaigns: Campaign[]) => void,
19
+ setCurrencySale: (currencySale: CurrencySales) => void,
20
+ setActiveCount: (activeCount: number) => void,
37
21
  setError: (error: string) => void,
38
22
  setIsLoading: (loading: boolean) => void
39
23
  ): Promise<void> => {
@@ -41,11 +25,9 @@ export const fetchCampaignsData = async (
41
25
 
42
26
  try {
43
27
  const data: any = await getData('apiHeaders');
44
- if (!data) {
45
- throw new Error('apiHeaders data not found.');
46
- }
28
+ if (!data) throw new Error('apiHeaders data not found.');
29
+
47
30
  const parsedHeaderData: ApiHeaders = JSON.parse(data);
48
- // setLanguage(parsedHeaderData.languageCode);
49
31
  setPremiumColor(parsedHeaderData.premiumColor);
50
32
 
51
33
  const headers = {
@@ -59,37 +41,130 @@ export const fetchCampaignsData = async (
59
41
  'User-Agent': parsedHeaderData.userAgent,
60
42
  };
61
43
 
62
- const response: AxiosResponse<{ data: Campaign[] }> = await axios.get(
63
- `https://api.tyrads.com/v3.0/campaigns?lang=${parsedHeaderData.languageCode}`,
64
- {
65
- headers: headers,
66
- }
67
- );
44
+ const langParam = `?lang=${parsedHeaderData.languageCode}`;
68
45
 
69
- const transformedCampaigns = transformCampaigns(response.data.data);
46
+ const [campaignsRes, currencyRes, summaryRes] = await Promise.all([
47
+ axios.get<{ data: Campaign[] }>(`https://api.tyrads.com/v3.0/campaigns${langParam}`, { headers }),
48
+ axios.get<{ data: { CurrencySales: CurrencySales } }>(`https://api.tyrads.com/v3.0/engagement${langParam}`, { headers }),
49
+ axios.get<{ data: { activeCampaignCount: number } }>(`https://api.tyrads.com/v3.0/activated-campaigns/summary${langParam}`, { headers })
50
+ ]);
70
51
 
71
- const hotOffers = transformedCampaigns
72
- .sort((a, b) => {
73
- if (a.premium && !b.premium) return -1;
74
- if (!a.premium && b.premium) return 1;
75
- return b.sortingScore - a.sortingScore;
76
- })
77
- .filter((item) => item.points > 0)
78
- .slice(0, 5);
52
+ const hotOffers = campaignsRes.data.data
53
+ .sort((a, b) => {
54
+ if (a.premium && !b.premium) return -1;
55
+ if (!a.premium && b.premium) return 1;
56
+ return b.sortingScore - a.sortingScore;
57
+ })
58
+ .filter(item => item.campaignPayout.totalPlayablePayoutConverted > 0)
59
+ .slice(0, 5);
60
+ // const currency: CurrencySales = {
61
+ // "name": "Ramadhan Karem",
62
+ // "multiplier": 1.5,
63
+ // "bannerUrl": "",
64
+ // "dateStart": "2025-03-10T00:00:00.000Z",
65
+ // "dateEnd": "2025-03-10T23:59:59.000Z",
66
+ // remainingTimeSeconds: undefined
67
+ // };
79
68
 
80
69
  setCampaigns(hotOffers);
70
+
71
+ setCurrencySale(currencyRes.data.data.CurrencySales);
72
+
73
+ setActiveCount(summaryRes.data.data.activeCampaignCount);
81
74
  } catch (error: any) {
82
75
  if (axios.isAxiosError(error) && error.response) {
83
76
  console.log('Response Error:', error.response.data);
84
- console.log('Status Code:', error.response.status);
85
- console.log('Response Headers:', error.response.headers);
86
77
  } else if (axios.isAxiosError(error) && error.request) {
87
78
  console.log('No Response from API:', error.request);
88
79
  } else {
89
- console.log('Error setting up request:', error.message);
80
+ console.log('Request Setup Error:', error.message);
90
81
  }
91
- setError('Something went wrong, please try again');
82
+ setError('Something went wrong, please try again.');
92
83
  } finally {
93
84
  setIsLoading(false);
94
85
  }
95
- };
86
+ };
87
+
88
+ const track = async (activity: string) => {
89
+ const data: any = await getData('apiHeaders');
90
+ if (!data) throw new Error('apiHeaders data not found.');
91
+
92
+ const parsedHeaderData: ApiHeaders = JSON.parse(data);
93
+
94
+ const headers = {
95
+ 'Content-Type': 'application/json',
96
+ Accept: 'application/json',
97
+ 'X-User-ID': parsedHeaderData.xUserId,
98
+ 'X-API-Key': parsedHeaderData.xApiKey,
99
+ 'X-API-Secret': parsedHeaderData.xApiSecret,
100
+ 'X-SDK-Platform': parsedHeaderData.xSdkPlatform,
101
+ 'X-SDK-Version': parsedHeaderData.xSdkVersion,
102
+ 'User-Agent': parsedHeaderData.userAgent,
103
+ };
104
+ try {
105
+ const fd = {
106
+ "activity": activity
107
+ };
108
+ await axios.post('https://api.tyrads.com/v3.0/user-activities', fd, { headers });
109
+ } catch (error) {
110
+ if (axios.isAxiosError(error) && error.response) {
111
+ console.log('Response Error:', error.response.data);
112
+ } else if (axios.isAxiosError(error) && error.request) {
113
+ console.log('No Response from API:', error.request);
114
+ } else {
115
+ console.log('Request Setup Error:', error);
116
+ }
117
+ }
118
+ }
119
+
120
+ export const openOffer = async (campaign: Campaign) => {
121
+ const campaignId = campaign.campaignId;
122
+ const clickUrl = campaign.tracking.clickUrl;
123
+ const isRetryDownload = campaign.isRetryDownload;
124
+ const isInstalled = campaign.isInstalled;
125
+ const previewUrl = campaign.app.previewUrl;
126
+ const s2sClickUrl = campaign.tracking.s2sClickUrl;
127
+
128
+ const data: any = await getData('apiHeaders');
129
+ if (!data) throw new Error('apiHeaders data not found.');
130
+
131
+ const parsedHeaderData: ApiHeaders = JSON.parse(data);
132
+
133
+ const headers = {
134
+ 'Content-Type': 'application/json',
135
+ Accept: 'application/json',
136
+ 'X-User-ID': parsedHeaderData.xUserId,
137
+ 'X-API-Key': parsedHeaderData.xApiKey,
138
+ 'X-API-Secret': parsedHeaderData.xApiSecret,
139
+ 'X-SDK-Platform': parsedHeaderData.xSdkPlatform,
140
+ 'X-SDK-Version': parsedHeaderData.xSdkVersion,
141
+ 'User-Agent': parsedHeaderData.userAgent,
142
+ };
143
+
144
+ try {
145
+ var url = clickUrl;
146
+ if (isInstalled) {
147
+ url = previewUrl;
148
+ } else {
149
+ if (isRetryDownload) {
150
+ await track("CampaignActivatedRetry");
151
+ } else {
152
+ await track("CampaignActivated");
153
+ }
154
+ await axios.post(`https://api.tyrads.com/v3.0/campaigns/active/${campaignId}`, {}, { headers });
155
+ }
156
+ if (s2sClickUrl != null) {
157
+ const res = await axios.get(s2sClickUrl);
158
+ if (res.status == 200) {
159
+ // url = res.data.url;
160
+ return;
161
+ }
162
+ }
163
+ await acmoLaunchURLForce(url);
164
+ } catch (error) {
165
+ console.log('=============Error=============');
166
+ console.log(error);
167
+ console.log('====================================');
168
+ }
169
+ }
170
+
@@ -2,44 +2,47 @@ import React, { useState, useEffect } from 'react';
2
2
  import {
3
3
  View,
4
4
  Text,
5
- ActivityIndicator,
6
5
  StyleSheet,
7
6
  } from 'react-native';
8
- import { fetchCampaignsData } from './repository';
7
+ import { fetchPremiumOfferDetails, openOffer } from './repository';
9
8
  import PremiumHeaderSection from './components/premium_header';
10
9
  import CustomCard from './components/custom_card';
11
- import MyGamesButton from './components/my_games_button';
12
- import PremiumOption1 from './components/premium_option_1';
13
- import PremiumOption2 from './components/premium_option_2';
14
- import PremiumOption3 from './components/premium_option_3';
15
- import PremiumOption4 from './components/premium_option_4';
10
+ import ActiveOffersButton from './components/active_offers_button';
11
+ import { AcmoOfferListItem } from './components/offer_list_item';
12
+ import AcmoOfferCard from './components/offer_card';
13
+ import AcmoScrollPager from './components/custom_scroller';
14
+ import PremiumEmptyView from './components/premium_empty_widget';
15
+ import PremiumWidgetsLoading from './components/premium_loading';
16
16
 
17
- interface TopOffersProps {
18
- showMore?: boolean;
19
- showMyOffers?: boolean;
20
- showMyOffersEmptyView?: boolean;
21
- style?: number;
17
+ export const enum PremiumWidgetStyles {
18
+ list,
19
+ sliderCards,
20
+ }
21
+
22
+ interface PremiumWidgetProps {
23
+ widgetStyle?: PremiumWidgetStyles;
22
24
  onNavigate: (route?: string, campaignID?: number) => void;
23
25
  }
24
26
 
25
- const TopOffers: React.FC<TopOffersProps> = ({
26
- showMore,
27
- showMyOffers = false,
28
- showMyOffersEmptyView = false,
29
- style = 1,
27
+ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
28
+ widgetStyle = PremiumWidgetStyles.list,
30
29
  onNavigate
31
30
  }) => {
32
- const [campaigns, setCampaigns] = useState<TransformedCampaign[]>([]);
31
+ const [campaigns, setCampaigns] = useState<Campaign[]>([]);
33
32
  const [isLoading, setIsLoading] = useState<boolean>(true);
34
33
  const [error, setError] = useState<string | null>(null);
35
34
  const [premiumColor, setPremiumColor] = useState<string>('#1C90DF');
36
- // const [language, setLanguage] = useState<string>('en');
35
+ const [currencySale, setCurrencySale] = useState<CurrencySales>();
36
+ const [activeCount, setActiveCount] = useState<number>(0);
37
+ const [loadingIndex, setLoadingIndex] = useState<number | null>(null);
38
+
37
39
 
38
40
  useEffect(() => {
39
- fetchCampaignsData(
40
- // setLanguage,
41
+ fetchPremiumOfferDetails(
41
42
  setPremiumColor,
42
43
  setCampaigns,
44
+ setCurrencySale,
45
+ setActiveCount,
43
46
  setError,
44
47
  setIsLoading
45
48
  );
@@ -49,18 +52,30 @@ const TopOffers: React.FC<TopOffersProps> = ({
49
52
  onNavigate();
50
53
  };
51
54
  const handleCampaignPress = (campaignId: number) => {
52
- onNavigate('campaign-details',campaignId );
55
+ onNavigate("offers", campaignId);
53
56
  };
54
57
 
55
- const handleMoreOffersPress = (route: string) => {
58
+ const handleActiveOffersPress = (route: string) => {
56
59
  onNavigate(route);
57
60
  };
58
61
 
62
+ const handleButtonPress = async (campaign: Campaign) => {
63
+ await openOffer(campaign);
64
+ await fetchPremiumOfferDetails(
65
+ setPremiumColor,
66
+ setCampaigns,
67
+ setCurrencySale,
68
+ setActiveCount,
69
+ setError,
70
+ setIsLoading
71
+ );
72
+ }
73
+
59
74
  if (isLoading) {
60
75
  return (
61
- <View style={styles.loadingContainer}>
62
- <ActivityIndicator size="large" color="#007AFF" />
63
- </View>
76
+ <PremiumWidgetsLoading
77
+ widgetStyle={widgetStyle}
78
+ />
64
79
  );
65
80
  }
66
81
 
@@ -72,53 +87,75 @@ const TopOffers: React.FC<TopOffersProps> = ({
72
87
  );
73
88
  }
74
89
 
90
+
75
91
  if (campaigns.length === 0) {
76
- if (showMyOffersEmptyView) {
77
- return (
78
- <View style={styles.noCampaignContainer}>
79
- <Text>No campaigns available</Text>
80
- </View>
81
- );
82
- } else {
83
- return <View />;
84
- }
92
+ return <PremiumEmptyView
93
+ colorPremium={premiumColor}
94
+ onContinue={handleShowOffers}
95
+ />
85
96
  }
86
97
 
87
98
  return (
88
- <CustomCard style={{}}>
99
+ <CustomCard style={{ flexDirection: 'row' }}>
89
100
  <View style={{ flex: 1 }}>
90
- <PremiumHeaderSection showMore={showMore} premiumColor={premiumColor} onShowOffers={handleShowOffers} />
101
+ <PremiumHeaderSection premiumColor={premiumColor} onShowOffers={handleShowOffers} />
91
102
  <View style={styles.headerSpacer} />
92
103
  {(() => {
93
- switch (style) {
94
- case 1:
104
+ switch (widgetStyle) {
105
+ case PremiumWidgetStyles.list:
95
106
  return (
96
- <PremiumOption1 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
107
+ campaigns.map((item, index) => (
108
+ <AcmoOfferListItem
109
+ key={index}
110
+ onPress={async () => handleCampaignPress && handleCampaignPress(item.campaignId)}
111
+ offer={item}
112
+ currencySales={currencySale}
113
+ index={index}
114
+ loadingIndex={loadingIndex}
115
+ setLoadingIndex={setLoadingIndex}
116
+ colorPremium={premiumColor}
117
+ onButtonTap={async () => handleButtonPress(item)}
118
+ />
119
+ ))
97
120
  );
98
- case 2:
121
+ case PremiumWidgetStyles.sliderCards:
99
122
  return (
100
- <PremiumOption2 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
101
- );
102
- case 3:
103
- return (
104
- <PremiumOption3 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
105
- );
106
- case 4:
107
- return (
108
- <PremiumOption4 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
123
+ <AcmoScrollPager
124
+ totalPages={campaigns.length}
125
+ activeIndicatorColor={premiumColor}
126
+ content={(index) => (
127
+ <AcmoOfferCard
128
+ item={campaigns[index]!}
129
+ onButtonClick={async () => handleButtonPress(campaigns[index]!)}
130
+ currencySaleModel={currencySale}
131
+ premiumColor={premiumColor}
132
+ isLoading={false}
133
+ onTap={async () => handleCampaignPress && handleCampaignPress(campaigns[index]!.campaignId)}
134
+ />
135
+ )}
136
+ />
109
137
  );
110
138
  default:
111
139
  return <Text>Please specify a correct style</Text>;
112
140
  }
113
141
  })()}
114
142
  <View style={styles.gameListSpacer} />
115
- {showMyOffers && <MyGamesButton premiumColor={premiumColor} onPress={handleMoreOffersPress}/>}
143
+ <ActiveOffersButton activeCount={activeCount} premiumColor={premiumColor} onPress={handleActiveOffersPress} />
116
144
  </View>
117
145
  </CustomCard>
118
146
  );
119
147
  };
120
148
 
121
149
  const styles = StyleSheet.create({
150
+ itemContainer: {
151
+ flexDirection: 'row',
152
+ flex: 1,
153
+ width: '100%',
154
+ justifyContent: 'space-between',
155
+ alignItems: 'center',
156
+ paddingHorizontal: 16,
157
+ paddingVertical: 8,
158
+ },
122
159
  loadingContainer: {
123
160
  flex: 1,
124
161
  justifyContent: 'center',
@@ -141,4 +178,4 @@ const styles = StyleSheet.create({
141
178
  },
142
179
  });
143
180
 
144
- export default TopOffers;
181
+ export default PremiumWidgets;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file