@tyrads.com/tyrads-sdk 2.0.1 → 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 (229) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +27 -6
  4. package/ios/Tyrads/AcmoConfig.swift +3 -3
  5. package/ios/Tyrads/InitModel.swift +5 -2
  6. package/ios/Tyrads/Tyrads.swift +117 -186
  7. package/ios/Tyrads/WebViewController.swift +171 -0
  8. package/ios/Tyrads/helpers/aes_encryptor.swift +81 -0
  9. package/ios/Tyrads/helpers/device_details.swift +58 -0
  10. package/ios/TyradsSdk.mm +10 -2
  11. package/ios/TyradsSdk.swift +44 -29
  12. package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
  13. package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
  14. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +76 -0
  15. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  16. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
  17. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  18. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
  19. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  20. package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
  21. package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  22. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +264 -0
  23. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  24. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +197 -0
  25. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +83 -0
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +12 -10
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +118 -0
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  32. package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
  33. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  34. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +70 -63
  35. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  36. package/lib/commonjs/assets/images/angle_up.png +0 -0
  37. package/lib/commonjs/assets/images/diamond.png +0 -0
  38. package/lib/commonjs/assets/images/info.png +0 -0
  39. package/lib/commonjs/assets/images/info_icon.png +0 -0
  40. package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
  41. package/lib/commonjs/assets/images/rank_1.png +0 -0
  42. package/lib/commonjs/assets/images/rank_2.png +0 -0
  43. package/lib/commonjs/assets/images/rank_3.png +0 -0
  44. package/lib/commonjs/assets/images/rank_4.png +0 -0
  45. package/lib/commonjs/assets/images/rank_5.png +0 -0
  46. package/lib/commonjs/index.js +15 -16
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/module/acmo/core/helpers/launcher.js +15 -0
  49. package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
  50. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +70 -0
  51. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  52. package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
  53. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  54. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
  55. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  56. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
  57. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  58. package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
  59. package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  60. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +191 -0
  61. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  62. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +78 -0
  63. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  64. package/lib/module/acmo/modules/dashboard/components/premium_header.js +12 -10
  65. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  66. package/lib/module/acmo/modules/dashboard/components/premium_loading.js +113 -0
  67. package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  68. package/lib/module/acmo/modules/dashboard/repository.js +105 -30
  69. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  70. package/lib/module/acmo/modules/dashboard/top_offers.js +71 -64
  71. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  72. package/lib/module/assets/images/angle_up.png +0 -0
  73. package/lib/module/assets/images/diamond.png +0 -0
  74. package/lib/module/assets/images/info.png +0 -0
  75. package/lib/module/assets/images/info_icon.png +0 -0
  76. package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
  77. package/lib/module/assets/images/rank_1.png +0 -0
  78. package/lib/module/assets/images/rank_2.png +0 -0
  79. package/lib/module/assets/images/rank_3.png +0 -0
  80. package/lib/module/assets/images/rank_4.png +0 -0
  81. package/lib/module/assets/images/rank_5.png +0 -0
  82. package/lib/module/index.js +15 -16
  83. package/lib/module/index.js.map +1 -1
  84. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
  85. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  88. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  91. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  93. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  95. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  97. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  99. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  101. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
  103. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  105. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/index.d.ts +6 -8
  107. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  108. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
  109. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  110. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  111. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  112. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  113. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  114. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  115. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  116. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  117. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  118. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  119. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  120. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  121. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  122. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  123. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  124. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +9 -0
  125. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  126. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
  127. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  128. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  129. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  130. package/lib/typescript/module/src/index.d.ts +6 -8
  131. package/lib/typescript/module/src/index.d.ts.map +1 -1
  132. package/package.json +3 -2
  133. package/readme.md +8 -8
  134. package/src/acmo/core/helpers/launcher.ts +14 -0
  135. package/src/acmo/core/types/types.d.ts +11 -13
  136. package/src/acmo/modules/dashboard/components/active_offers_button.tsx +61 -0
  137. package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
  138. package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
  139. package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
  140. package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
  141. package/src/acmo/modules/dashboard/components/offer_list_item.tsx +225 -0
  142. package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +76 -0
  143. package/src/acmo/modules/dashboard/components/premium_header.tsx +8 -8
  144. package/src/acmo/modules/dashboard/components/premium_loading.tsx +78 -0
  145. package/src/acmo/modules/dashboard/repository.ts +121 -46
  146. package/src/acmo/modules/dashboard/top_offers.tsx +89 -52
  147. package/src/assets/images/angle_up.png +0 -0
  148. package/src/assets/images/diamond.png +0 -0
  149. package/src/assets/images/info.png +0 -0
  150. package/src/assets/images/info_icon.png +0 -0
  151. package/src/assets/images/premium-emptybg.jpeg +0 -0
  152. package/src/assets/images/rank_1.png +0 -0
  153. package/src/assets/images/rank_2.png +0 -0
  154. package/src/assets/images/rank_3.png +0 -0
  155. package/src/assets/images/rank_4.png +0 -0
  156. package/src/assets/images/rank_5.png +0 -0
  157. package/src/index.tsx +19 -23
  158. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +0 -112
  159. package/lib/commonjs/acmo/core/marquee.js.map +0 -1
  160. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
  161. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  162. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
  163. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  164. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
  165. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  166. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -181
  167. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  168. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
  169. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  170. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
  171. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  172. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
  173. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  174. package/lib/module/acmo/core/marquee.js +0 -54
  175. package/lib/module/acmo/core/marquee.js.map +0 -1
  176. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
  177. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  178. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
  179. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  180. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
  181. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  182. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -176
  183. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  184. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
  185. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  186. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
  187. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  188. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
  189. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  190. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
  191. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  193. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  195. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  197. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  199. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  201. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  202. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  203. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  205. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  206. package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
  207. package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
  208. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  209. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  210. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  211. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  212. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  213. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  214. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  215. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  216. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  217. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  218. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  219. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  220. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  221. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  222. package/src/acmo/core/marquee.tsx +0 -62
  223. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
  224. package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
  225. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
  226. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -156
  227. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
  228. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
  229. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
@@ -0,0 +1,225 @@
1
+ import React from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ Image,
7
+ StyleSheet,
8
+ ActivityIndicator,
9
+ } from 'react-native';
10
+ import numeral from 'numeral';
11
+
12
+
13
+
14
+ type Props = {
15
+ offer: Campaign;
16
+ currencySales?: CurrencySales;
17
+ onButtonTap: () => Promise<void>;
18
+ onPress: () => Promise<void>;
19
+ index: number;
20
+ colorPremium?: string;
21
+ colorPremiumFg?: string;
22
+ loadingIndex: number | null;
23
+ setLoadingIndex: (index: number | null) => void;
24
+ };
25
+
26
+ const rankIcons = [
27
+ require('../../../../assets/images/rank_1.png'),
28
+ require('../../../../assets/images/rank_2.png'),
29
+ require('../../../../assets/images/rank_3.png'),
30
+ require('../../../../assets/images/rank_4.png'),
31
+ require('../../../../assets/images/rank_5.png'),
32
+ ];
33
+
34
+ export const AcmoOfferListItem: React.FC<Props> = ({
35
+ offer,
36
+ currencySales,
37
+ onButtonTap,
38
+ onPress,
39
+ index,
40
+ colorPremium,
41
+ colorPremiumFg,
42
+ loadingIndex,
43
+ setLoadingIndex,
44
+ }) => {
45
+ const bonusMultiplier = currencySales?.multiplier ?? 1;
46
+ const isLoading = loadingIndex === index;
47
+ const anyLoading = loadingIndex != null;
48
+
49
+ return (
50
+ <TouchableOpacity
51
+ disabled={anyLoading}
52
+ onPress={onPress}
53
+ style={styles.itemContainer}
54
+ activeOpacity={0.75}
55
+ >
56
+ <View style={styles.container}>
57
+ <Image source={rankIcons[index]} style={styles.rankIcon} />
58
+
59
+ <Image source={{ uri: offer.app.thumbnail }} style={styles.icon} />
60
+
61
+ <View style={styles.details}>
62
+ {currencySales && (
63
+ <View style={[styles.bonusBadge, { backgroundColor: `${colorPremium}20` }]}>
64
+ <Text style={[styles.bonusText, { color: colorPremium }]}>
65
+ {bonusMultiplier}x BONUS
66
+ </Text>
67
+ </View>
68
+ )}
69
+
70
+ <Text numberOfLines={1} style={styles.title} ellipsizeMode="tail">
71
+ {offer.app.title}
72
+ </Text>
73
+
74
+ <View style={styles.payoutRow}>
75
+ {currencySales && (
76
+ <Text style={styles.strikeText}>
77
+ {numeral(offer.campaignPayout.totalPlayablePayoutConverted).format('0.00a')}
78
+ </Text>
79
+ )}
80
+
81
+ <Image
82
+ source={{ uri: offer.currency.adUnitCurrencyIcon }}
83
+ style={styles.currencyIcon}
84
+ />
85
+
86
+ <Text style={styles.payoutText}>
87
+ {numeral(
88
+ offer.campaignPayout.totalPlayablePayoutConverted * bonusMultiplier
89
+ ).format('0.00a')}
90
+ </Text>
91
+ </View>
92
+ </View>
93
+
94
+ <TouchableOpacity
95
+ disabled={anyLoading}
96
+ style={[
97
+ styles.button,
98
+ { backgroundColor: anyLoading ? '#e0e2e7' : colorPremium },
99
+ ]}
100
+ onPress={async () => {
101
+ setLoadingIndex(index)
102
+ await onButtonTap();
103
+ setLoadingIndex(null);
104
+ }}
105
+ >
106
+ {isLoading ? (
107
+ <ActivityIndicator size="small" color="#a3a9b6" />
108
+ ) : null}
109
+ <Text
110
+ style={[
111
+ styles.buttonText,
112
+ {
113
+ color: anyLoading ? '#a3a9b6' : colorPremiumFg ?? '#fff',
114
+ marginLeft: isLoading ? 8 : 0,
115
+ },
116
+ ]}
117
+ >
118
+ Play
119
+ </Text>
120
+ </TouchableOpacity>
121
+
122
+ </View>
123
+ </TouchableOpacity>
124
+ );
125
+ };
126
+
127
+
128
+ const styles = StyleSheet.create({
129
+ itemContainer: {
130
+ flexDirection: 'row',
131
+ flex: 1,
132
+ width: '100%',
133
+ justifyContent: 'space-between',
134
+ alignItems: 'center',
135
+ paddingHorizontal: 16,
136
+ paddingVertical: 8,
137
+ },
138
+ container: {
139
+ flexDirection: 'row',
140
+ marginVertical: 2,
141
+ paddingHorizontal: 0,
142
+ width: '100%',
143
+ position: 'relative',
144
+ },
145
+ rankIcon: {
146
+ position: 'absolute',
147
+ zIndex: 99,
148
+ left: -10,
149
+ top: -8,
150
+ width: 24,
151
+ height: 24,
152
+ resizeMode: 'contain',
153
+ },
154
+ row: {
155
+ flexDirection: 'row',
156
+ alignItems: 'center',
157
+ backgroundColor: '#fff',
158
+ borderRadius: 8,
159
+ padding: 10,
160
+ elevation: 2,
161
+ },
162
+ icon: {
163
+ width: 54,
164
+ height: 54,
165
+ borderRadius: 4,
166
+ marginRight: 10,
167
+ },
168
+ details: {
169
+ flex: 1,
170
+ justifyContent: 'center',
171
+ },
172
+ bonusBadge: {
173
+ alignSelf: 'flex-start',
174
+ paddingHorizontal: 8,
175
+ paddingVertical: 2,
176
+ borderRadius: 16,
177
+ marginBottom: 4,
178
+ },
179
+ bonusText: {
180
+ fontSize: 10,
181
+ fontWeight: '700',
182
+ },
183
+ title: {
184
+ fontSize: 12,
185
+ fontWeight: '500',
186
+ marginBottom: 4,
187
+ color: '#323434',
188
+ },
189
+ payoutRow: {
190
+ flexDirection: 'row',
191
+ alignItems: 'center',
192
+ gap: 10,
193
+ },
194
+ strikeText: {
195
+ fontSize: 12,
196
+ textDecorationLine: 'line-through',
197
+ color: '#323434',
198
+ fontWeight: '300',
199
+ },
200
+ currencyIcon: {
201
+ width: 14,
202
+ height: 14,
203
+ marginHorizontal: 4,
204
+ },
205
+ payoutText: {
206
+ fontSize: 12,
207
+ fontWeight: '700',
208
+ color: '#323434',
209
+ },
210
+ button: {
211
+ marginLeft: 4,
212
+ paddingHorizontal: 12,
213
+ height: 42,
214
+ minWidth: 75,
215
+ justifyContent: 'center',
216
+ alignItems: 'center',
217
+ borderRadius: 8,
218
+ flexDirection: 'row',
219
+ },
220
+ buttonText: {
221
+ fontSize: 14,
222
+ fontWeight: '600',
223
+ color: '#fff',
224
+ },
225
+ });
@@ -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/v2.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
+