@tyrads.com/tyrads-sdk 3.3.4 → 4.0.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 (429) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +161 -19
  3. package/ios/Tyrads/AcmoConfig.swift +1 -1
  4. package/ios/Tyrads/InitModel.swift +29 -15
  5. package/ios/Tyrads/Tyrads.swift +332 -274
  6. package/ios/Tyrads/WebViewController.swift +10 -17
  7. package/ios/Tyrads/core/models/TyradsUserInfo.swift +2 -0
  8. package/ios/Tyrads/core/utils/AcmoKeyNames.swift +1 -0
  9. package/ios/Tyrads/helpers/device_details.swift +122 -2
  10. package/ios/Tyrads/pushNotifications/APNsAppDelegateProxy.swift +37 -0
  11. package/ios/Tyrads/pushNotifications/APNsNotificationListener.swift +14 -0
  12. package/ios/Tyrads/pushNotifications/APNsNotificationManager.swift +68 -0
  13. package/ios/Tyrads/pushNotifications/APNsNotificationReceiver.swift +77 -0
  14. package/ios/Tyrads/pushNotifications/TyradsAPNsSwizzler.mm +179 -0
  15. package/ios/TyradsSdk-Bridging-Header.h +3 -0
  16. package/ios/TyradsSdk.mm +12 -1
  17. package/ios/TyradsSdk.swift +121 -4
  18. package/lib/commonjs/acmo/core/components/countdown-timer.js +48 -0
  19. package/lib/commonjs/acmo/core/components/countdown-timer.js.map +1 -0
  20. package/lib/commonjs/acmo/core/components/snap-carousel.js +86 -0
  21. package/lib/commonjs/acmo/core/components/snap-carousel.js.map +1 -0
  22. package/lib/commonjs/acmo/core/constants/api-endpoints.js +18 -0
  23. package/lib/commonjs/acmo/core/constants/api-endpoints.js.map +1 -0
  24. package/lib/commonjs/acmo/core/helpers/colors.js +20 -0
  25. package/lib/commonjs/acmo/core/helpers/colors.js.map +1 -0
  26. package/lib/commonjs/acmo/core/helpers/logger.js +18 -0
  27. package/lib/commonjs/acmo/core/helpers/logger.js.map +1 -0
  28. package/lib/commonjs/acmo/core/helpers/patches.js +7 -0
  29. package/lib/commonjs/acmo/core/helpers/patches.js.map +1 -0
  30. package/lib/commonjs/acmo/core/network/http-client.js +91 -0
  31. package/lib/commonjs/acmo/core/network/http-client.js.map +1 -0
  32. package/lib/commonjs/acmo/core/network/network-common.js +111 -0
  33. package/lib/commonjs/acmo/core/network/network-common.js.map +1 -0
  34. package/lib/commonjs/acmo/core/services/localization_service.js +7 -13
  35. package/lib/commonjs/acmo/core/services/localization_service.js.map +1 -1
  36. package/lib/commonjs/acmo/core/types/activated-campaings.d.js +2 -0
  37. package/lib/commonjs/acmo/core/types/activated-campaings.d.js.map +1 -0
  38. package/lib/commonjs/acmo/core/tyrads-sdk-core.js +203 -0
  39. package/lib/commonjs/acmo/core/tyrads-sdk-core.js.map +1 -0
  40. package/lib/commonjs/acmo/modules/inapp-notifications/components/gradient_card.js +98 -0
  41. package/lib/commonjs/acmo/modules/inapp-notifications/components/gradient_card.js.map +1 -0
  42. package/lib/commonjs/acmo/modules/inapp-notifications/components/modal-wrapper.js +55 -0
  43. package/lib/commonjs/acmo/modules/inapp-notifications/components/modal-wrapper.js.map +1 -0
  44. package/lib/commonjs/acmo/modules/inapp-notifications/controller.js +141 -0
  45. package/lib/commonjs/acmo/modules/inapp-notifications/controller.js.map +1 -0
  46. package/lib/commonjs/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.js +183 -0
  47. package/lib/commonjs/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.js.map +1 -0
  48. package/lib/commonjs/acmo/modules/inapp-notifications/inapp-notification-host.js +37 -0
  49. package/lib/commonjs/acmo/modules/inapp-notifications/inapp-notification-host.js.map +1 -0
  50. package/lib/commonjs/acmo/modules/inapp-notifications/inapp-notification-manager.js +39 -0
  51. package/lib/commonjs/acmo/modules/inapp-notifications/inapp-notification-manager.js.map +1 -0
  52. package/lib/commonjs/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.js +206 -0
  53. package/lib/commonjs/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.js.map +1 -0
  54. package/lib/commonjs/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.js +155 -0
  55. package/lib/commonjs/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.js.map +1 -0
  56. package/lib/commonjs/acmo/modules/inapp-notifications/repository.js +52 -0
  57. package/lib/commonjs/acmo/modules/inapp-notifications/repository.js.map +1 -0
  58. package/lib/commonjs/acmo/modules/inapp-notifications/tyrads-global-host.js +37 -0
  59. package/lib/commonjs/acmo/modules/inapp-notifications/tyrads-global-host.js.map +1 -0
  60. package/lib/commonjs/acmo/modules/premium-widgets/components/active_offers_button.js.map +1 -0
  61. package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/custom_card.js +1 -2
  62. package/lib/commonjs/acmo/modules/premium-widgets/components/custom_card.js.map +1 -0
  63. package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/custom_scroller.js +20 -11
  64. package/lib/commonjs/acmo/modules/premium-widgets/components/custom_scroller.js.map +1 -0
  65. package/lib/commonjs/acmo/modules/premium-widgets/components/custom_shimmer.js.map +1 -0
  66. package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/offer_card.js +12 -12
  67. package/lib/commonjs/acmo/modules/premium-widgets/components/offer_card.js.map +1 -0
  68. package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/offer_list_item.js +3 -3
  69. package/lib/commonjs/acmo/modules/premium-widgets/components/offer_list_item.js.map +1 -0
  70. package/lib/commonjs/acmo/modules/premium-widgets/components/premium_empty_widget.js.map +1 -0
  71. package/lib/commonjs/acmo/modules/premium-widgets/components/premium_header.js.map +1 -0
  72. package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/premium_loading.js +3 -3
  73. package/lib/commonjs/acmo/modules/premium-widgets/components/premium_loading.js.map +1 -0
  74. package/lib/commonjs/acmo/modules/premium-widgets/controller.js +30 -0
  75. package/lib/commonjs/acmo/modules/premium-widgets/controller.js.map +1 -0
  76. package/lib/commonjs/acmo/modules/{dashboard/top_offers.js → premium-widgets/premium_offers_widget.js} +67 -30
  77. package/lib/commonjs/acmo/modules/premium-widgets/premium_offers_widget.js.map +1 -0
  78. package/lib/commonjs/acmo/modules/premium-widgets/premium_offers_widget_wrapper.js +49 -0
  79. package/lib/commonjs/acmo/modules/premium-widgets/premium_offers_widget_wrapper.js.map +1 -0
  80. package/lib/commonjs/acmo/modules/premium-widgets/repository.js +103 -0
  81. package/lib/commonjs/acmo/modules/premium-widgets/repository.js.map +1 -0
  82. package/lib/commonjs/acmo/modules/push-notifications/apns-manager.js +227 -0
  83. package/lib/commonjs/acmo/modules/push-notifications/apns-manager.js.map +1 -0
  84. package/lib/commonjs/acmo/modules/push-notifications/fcm-manager.js +148 -0
  85. package/lib/commonjs/acmo/modules/push-notifications/fcm-manager.js.map +1 -0
  86. package/lib/commonjs/acmo_config.js +6 -5
  87. package/lib/commonjs/acmo_config.js.map +1 -1
  88. package/lib/commonjs/assets/images/alarm-clock.png +0 -0
  89. package/lib/commonjs/assets/images/circle-x.png +0 -0
  90. package/lib/commonjs/assets/images/coin.png +0 -0
  91. package/lib/commonjs/index.js +33 -106
  92. package/lib/commonjs/index.js.map +1 -1
  93. package/lib/module/acmo/core/components/countdown-timer.js +42 -0
  94. package/lib/module/acmo/core/components/countdown-timer.js.map +1 -0
  95. package/lib/module/acmo/core/components/snap-carousel.js +81 -0
  96. package/lib/module/acmo/core/components/snap-carousel.js.map +1 -0
  97. package/lib/module/acmo/core/constants/api-endpoints.js +14 -0
  98. package/lib/module/acmo/core/constants/api-endpoints.js.map +1 -0
  99. package/lib/module/acmo/core/helpers/colors.js +15 -0
  100. package/lib/module/acmo/core/helpers/colors.js.map +1 -0
  101. package/lib/module/acmo/core/helpers/logger.js +14 -0
  102. package/lib/module/acmo/core/helpers/logger.js.map +1 -0
  103. package/lib/module/acmo/core/helpers/patches.js +7 -0
  104. package/lib/module/acmo/core/helpers/patches.js.map +1 -0
  105. package/lib/module/acmo/core/network/http-client.js +86 -0
  106. package/lib/module/acmo/core/network/http-client.js.map +1 -0
  107. package/lib/module/acmo/core/network/network-common.js +106 -0
  108. package/lib/module/acmo/core/network/network-common.js.map +1 -0
  109. package/lib/module/acmo/core/services/localization_service.js +7 -13
  110. package/lib/module/acmo/core/services/localization_service.js.map +1 -1
  111. package/lib/module/acmo/core/types/activated-campaings.d.js +2 -0
  112. package/lib/module/acmo/core/types/activated-campaings.d.js.map +1 -0
  113. package/lib/module/acmo/core/tyrads-sdk-core.js +197 -0
  114. package/lib/module/acmo/core/tyrads-sdk-core.js.map +1 -0
  115. package/lib/module/acmo/modules/inapp-notifications/components/gradient_card.js +92 -0
  116. package/lib/module/acmo/modules/inapp-notifications/components/gradient_card.js.map +1 -0
  117. package/lib/module/acmo/modules/inapp-notifications/components/modal-wrapper.js +49 -0
  118. package/lib/module/acmo/modules/inapp-notifications/components/modal-wrapper.js.map +1 -0
  119. package/lib/module/acmo/modules/inapp-notifications/controller.js +136 -0
  120. package/lib/module/acmo/modules/inapp-notifications/controller.js.map +1 -0
  121. package/lib/module/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.js +176 -0
  122. package/lib/module/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.js.map +1 -0
  123. package/lib/module/acmo/modules/inapp-notifications/inapp-notification-host.js +32 -0
  124. package/lib/module/acmo/modules/inapp-notifications/inapp-notification-host.js.map +1 -0
  125. package/lib/module/acmo/modules/inapp-notifications/inapp-notification-manager.js +35 -0
  126. package/lib/module/acmo/modules/inapp-notifications/inapp-notification-manager.js.map +1 -0
  127. package/lib/module/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.js +200 -0
  128. package/lib/module/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.js.map +1 -0
  129. package/lib/module/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.js +149 -0
  130. package/lib/module/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.js.map +1 -0
  131. package/lib/module/acmo/modules/inapp-notifications/repository.js +47 -0
  132. package/lib/module/acmo/modules/inapp-notifications/repository.js.map +1 -0
  133. package/lib/module/acmo/modules/inapp-notifications/tyrads-global-host.js +32 -0
  134. package/lib/module/acmo/modules/inapp-notifications/tyrads-global-host.js.map +1 -0
  135. package/lib/module/acmo/modules/premium-widgets/components/active_offers_button.js.map +1 -0
  136. package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/custom_card.js +1 -2
  137. package/lib/module/acmo/modules/premium-widgets/components/custom_card.js.map +1 -0
  138. package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/custom_scroller.js +20 -11
  139. package/lib/module/acmo/modules/premium-widgets/components/custom_scroller.js.map +1 -0
  140. package/lib/module/acmo/modules/premium-widgets/components/custom_shimmer.js.map +1 -0
  141. package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/offer_card.js +12 -12
  142. package/lib/module/acmo/modules/premium-widgets/components/offer_card.js.map +1 -0
  143. package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/offer_list_item.js +3 -3
  144. package/lib/module/acmo/modules/premium-widgets/components/offer_list_item.js.map +1 -0
  145. package/lib/module/acmo/modules/premium-widgets/components/premium_empty_widget.js.map +1 -0
  146. package/lib/module/acmo/modules/premium-widgets/components/premium_header.js.map +1 -0
  147. package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/premium_loading.js +1 -1
  148. package/lib/module/acmo/modules/premium-widgets/components/premium_loading.js.map +1 -0
  149. package/lib/module/acmo/modules/premium-widgets/controller.js +25 -0
  150. package/lib/module/acmo/modules/premium-widgets/controller.js.map +1 -0
  151. package/lib/module/acmo/modules/{dashboard/top_offers.js → premium-widgets/premium_offers_widget.js} +69 -32
  152. package/lib/module/acmo/modules/premium-widgets/premium_offers_widget.js.map +1 -0
  153. package/lib/module/acmo/modules/premium-widgets/premium_offers_widget_wrapper.js +41 -0
  154. package/lib/module/acmo/modules/premium-widgets/premium_offers_widget_wrapper.js.map +1 -0
  155. package/lib/module/acmo/modules/premium-widgets/repository.js +98 -0
  156. package/lib/module/acmo/modules/premium-widgets/repository.js.map +1 -0
  157. package/lib/module/acmo/modules/push-notifications/apns-manager.js +222 -0
  158. package/lib/module/acmo/modules/push-notifications/apns-manager.js.map +1 -0
  159. package/lib/module/acmo/modules/push-notifications/fcm-manager.js +143 -0
  160. package/lib/module/acmo/modules/push-notifications/fcm-manager.js.map +1 -0
  161. package/lib/module/acmo_config.js +6 -5
  162. package/lib/module/acmo_config.js.map +1 -1
  163. package/lib/module/assets/images/alarm-clock.png +0 -0
  164. package/lib/module/assets/images/circle-x.png +0 -0
  165. package/lib/module/assets/images/coin.png +0 -0
  166. package/lib/module/index.js +16 -106
  167. package/lib/module/index.js.map +1 -1
  168. package/lib/typescript/commonjs/src/acmo/core/components/countdown-timer.d.ts +8 -0
  169. package/lib/typescript/commonjs/src/acmo/core/components/countdown-timer.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/acmo/core/components/snap-carousel.d.ts +26 -0
  171. package/lib/typescript/commonjs/src/acmo/core/components/snap-carousel.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/acmo/core/constants/api-endpoints.d.ts +12 -0
  173. package/lib/typescript/commonjs/src/acmo/core/constants/api-endpoints.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/acmo/core/helpers/colors.d.ts +2 -0
  175. package/lib/typescript/commonjs/src/acmo/core/helpers/colors.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/src/acmo/core/helpers/logger.d.ts +6 -0
  177. package/lib/typescript/commonjs/src/acmo/core/helpers/logger.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/src/acmo/core/network/http-client.d.ts +28 -0
  179. package/lib/typescript/commonjs/src/acmo/core/network/http-client.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/src/acmo/core/network/network-common.d.ts +13 -0
  181. package/lib/typescript/commonjs/src/acmo/core/network/network-common.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts +0 -1
  183. package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/src/acmo/core/types/external_types.d.ts +5 -0
  185. package/lib/typescript/commonjs/src/acmo/core/types/external_types.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/src/acmo/core/tyrads-sdk-core.d.ts +46 -0
  187. package/lib/typescript/commonjs/src/acmo/core/tyrads-sdk-core.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/components/gradient_card.d.ts +17 -0
  189. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/components/gradient_card.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/components/modal-wrapper.d.ts +10 -0
  191. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/components/modal-wrapper.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/controller.d.ts +22 -0
  193. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/controller.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.d.ts +6 -0
  195. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/inapp-notification-host.d.ts +7 -0
  197. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/inapp-notification-host.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/inapp-notification-manager.d.ts +14 -0
  199. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/inapp-notification-manager.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.d.ts +4 -0
  201. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.d.ts +7 -0
  203. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/repository.d.ts +8 -0
  205. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/repository.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/tyrads-global-host.d.ts +6 -0
  207. package/lib/typescript/commonjs/src/acmo/modules/inapp-notifications/tyrads-global-host.d.ts.map +1 -0
  208. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/active_offers_button.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/custom_card.d.ts.map +1 -0
  210. package/lib/typescript/{module/src/acmo/modules/dashboard → commonjs/src/acmo/modules/premium-widgets}/components/custom_scroller.d.ts +3 -0
  211. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/custom_scroller.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/custom_shimmer.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/offer_card.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/offer_list_item.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/premium_empty_widget.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/premium_header.d.ts.map +1 -0
  217. package/lib/typescript/{module/src/acmo/modules/dashboard → commonjs/src/acmo/modules/premium-widgets}/components/premium_loading.d.ts +1 -1
  218. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/components/premium_loading.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/controller.d.ts +14 -0
  220. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/controller.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/src/acmo/modules/{dashboard/top_offers.d.ts → premium-widgets/premium_offers_widget.d.ts} +3 -3
  222. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/premium_offers_widget.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/premium_offers_widget_wrapper.d.ts +9 -0
  224. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/premium_offers_widget_wrapper.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/repository.d.ts +13 -0
  226. package/lib/typescript/commonjs/src/acmo/modules/premium-widgets/repository.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/src/acmo/modules/push-notifications/apns-manager.d.ts +40 -0
  228. package/lib/typescript/commonjs/src/acmo/modules/push-notifications/apns-manager.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/src/acmo/modules/push-notifications/fcm-manager.d.ts +32 -0
  230. package/lib/typescript/commonjs/src/acmo/modules/push-notifications/fcm-manager.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/src/acmo_config.d.ts +1 -0
  232. package/lib/typescript/commonjs/src/acmo_config.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/index.d.ts +5 -11
  234. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  235. package/lib/typescript/module/src/acmo/core/components/countdown-timer.d.ts +8 -0
  236. package/lib/typescript/module/src/acmo/core/components/countdown-timer.d.ts.map +1 -0
  237. package/lib/typescript/module/src/acmo/core/components/snap-carousel.d.ts +26 -0
  238. package/lib/typescript/module/src/acmo/core/components/snap-carousel.d.ts.map +1 -0
  239. package/lib/typescript/module/src/acmo/core/constants/api-endpoints.d.ts +12 -0
  240. package/lib/typescript/module/src/acmo/core/constants/api-endpoints.d.ts.map +1 -0
  241. package/lib/typescript/module/src/acmo/core/helpers/colors.d.ts +2 -0
  242. package/lib/typescript/module/src/acmo/core/helpers/colors.d.ts.map +1 -0
  243. package/lib/typescript/module/src/acmo/core/helpers/logger.d.ts +6 -0
  244. package/lib/typescript/module/src/acmo/core/helpers/logger.d.ts.map +1 -0
  245. package/lib/typescript/module/src/acmo/core/network/http-client.d.ts +28 -0
  246. package/lib/typescript/module/src/acmo/core/network/http-client.d.ts.map +1 -0
  247. package/lib/typescript/module/src/acmo/core/network/network-common.d.ts +13 -0
  248. package/lib/typescript/module/src/acmo/core/network/network-common.d.ts.map +1 -0
  249. package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts +0 -1
  250. package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts.map +1 -1
  251. package/lib/typescript/module/src/acmo/core/types/external_types.d.ts +5 -0
  252. package/lib/typescript/module/src/acmo/core/types/external_types.d.ts.map +1 -1
  253. package/lib/typescript/module/src/acmo/core/tyrads-sdk-core.d.ts +46 -0
  254. package/lib/typescript/module/src/acmo/core/tyrads-sdk-core.d.ts.map +1 -0
  255. package/lib/typescript/module/src/acmo/modules/inapp-notifications/components/gradient_card.d.ts +17 -0
  256. package/lib/typescript/module/src/acmo/modules/inapp-notifications/components/gradient_card.d.ts.map +1 -0
  257. package/lib/typescript/module/src/acmo/modules/inapp-notifications/components/modal-wrapper.d.ts +10 -0
  258. package/lib/typescript/module/src/acmo/modules/inapp-notifications/components/modal-wrapper.d.ts.map +1 -0
  259. package/lib/typescript/module/src/acmo/modules/inapp-notifications/controller.d.ts +22 -0
  260. package/lib/typescript/module/src/acmo/modules/inapp-notifications/controller.d.ts.map +1 -0
  261. package/lib/typescript/module/src/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.d.ts +6 -0
  262. package/lib/typescript/module/src/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.d.ts.map +1 -0
  263. package/lib/typescript/module/src/acmo/modules/inapp-notifications/inapp-notification-host.d.ts +7 -0
  264. package/lib/typescript/module/src/acmo/modules/inapp-notifications/inapp-notification-host.d.ts.map +1 -0
  265. package/lib/typescript/module/src/acmo/modules/inapp-notifications/inapp-notification-manager.d.ts +14 -0
  266. package/lib/typescript/module/src/acmo/modules/inapp-notifications/inapp-notification-manager.d.ts.map +1 -0
  267. package/lib/typescript/module/src/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.d.ts +4 -0
  268. package/lib/typescript/module/src/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.d.ts.map +1 -0
  269. package/lib/typescript/module/src/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.d.ts +7 -0
  270. package/lib/typescript/module/src/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.d.ts.map +1 -0
  271. package/lib/typescript/module/src/acmo/modules/inapp-notifications/repository.d.ts +8 -0
  272. package/lib/typescript/module/src/acmo/modules/inapp-notifications/repository.d.ts.map +1 -0
  273. package/lib/typescript/module/src/acmo/modules/inapp-notifications/tyrads-global-host.d.ts +6 -0
  274. package/lib/typescript/module/src/acmo/modules/inapp-notifications/tyrads-global-host.d.ts.map +1 -0
  275. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/active_offers_button.d.ts.map +1 -0
  276. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/custom_card.d.ts.map +1 -0
  277. package/lib/typescript/{commonjs/src/acmo/modules/dashboard → module/src/acmo/modules/premium-widgets}/components/custom_scroller.d.ts +3 -0
  278. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/custom_scroller.d.ts.map +1 -0
  279. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/custom_shimmer.d.ts.map +1 -0
  280. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/offer_card.d.ts.map +1 -0
  281. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/offer_list_item.d.ts.map +1 -0
  282. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/premium_empty_widget.d.ts.map +1 -0
  283. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/premium_header.d.ts.map +1 -0
  284. package/lib/typescript/{commonjs/src/acmo/modules/dashboard → module/src/acmo/modules/premium-widgets}/components/premium_loading.d.ts +1 -1
  285. package/lib/typescript/module/src/acmo/modules/premium-widgets/components/premium_loading.d.ts.map +1 -0
  286. package/lib/typescript/module/src/acmo/modules/premium-widgets/controller.d.ts +14 -0
  287. package/lib/typescript/module/src/acmo/modules/premium-widgets/controller.d.ts.map +1 -0
  288. package/lib/typescript/module/src/acmo/modules/{dashboard/top_offers.d.ts → premium-widgets/premium_offers_widget.d.ts} +3 -3
  289. package/lib/typescript/module/src/acmo/modules/premium-widgets/premium_offers_widget.d.ts.map +1 -0
  290. package/lib/typescript/module/src/acmo/modules/premium-widgets/premium_offers_widget_wrapper.d.ts +9 -0
  291. package/lib/typescript/module/src/acmo/modules/premium-widgets/premium_offers_widget_wrapper.d.ts.map +1 -0
  292. package/lib/typescript/module/src/acmo/modules/premium-widgets/repository.d.ts +13 -0
  293. package/lib/typescript/module/src/acmo/modules/premium-widgets/repository.d.ts.map +1 -0
  294. package/lib/typescript/module/src/acmo/modules/push-notifications/apns-manager.d.ts +40 -0
  295. package/lib/typescript/module/src/acmo/modules/push-notifications/apns-manager.d.ts.map +1 -0
  296. package/lib/typescript/module/src/acmo/modules/push-notifications/fcm-manager.d.ts +32 -0
  297. package/lib/typescript/module/src/acmo/modules/push-notifications/fcm-manager.d.ts.map +1 -0
  298. package/lib/typescript/module/src/acmo_config.d.ts +1 -0
  299. package/lib/typescript/module/src/acmo_config.d.ts.map +1 -1
  300. package/lib/typescript/module/src/index.d.ts +5 -11
  301. package/lib/typescript/module/src/index.d.ts.map +1 -1
  302. package/package.json +5 -3
  303. package/readme.md +27 -14
  304. package/src/acmo/core/components/countdown-timer.tsx +52 -0
  305. package/src/acmo/core/components/snap-carousel.tsx +106 -0
  306. package/src/acmo/core/constants/api-endpoints.ts +12 -0
  307. package/src/acmo/core/helpers/colors.ts +16 -0
  308. package/src/acmo/core/helpers/logger.ts +11 -0
  309. package/src/acmo/core/helpers/patches.js +6 -0
  310. package/src/acmo/core/network/http-client.ts +89 -0
  311. package/src/acmo/core/network/network-common.ts +128 -0
  312. package/src/acmo/core/services/localization_service.ts +7 -14
  313. package/src/acmo/core/types/activated-campaings.d.ts +101 -0
  314. package/src/acmo/core/types/external_types.ts +7 -1
  315. package/src/acmo/core/types/types.d.ts +112 -76
  316. package/src/acmo/core/tyrads-sdk-core.tsx +256 -0
  317. package/src/acmo/modules/inapp-notifications/components/gradient_card.tsx +87 -0
  318. package/src/acmo/modules/inapp-notifications/components/modal-wrapper.tsx +59 -0
  319. package/src/acmo/modules/inapp-notifications/controller.ts +183 -0
  320. package/src/acmo/modules/inapp-notifications/currency-sales/currency-sales-notif.tsx +164 -0
  321. package/src/acmo/modules/inapp-notifications/inapp-notification-host.tsx +32 -0
  322. package/src/acmo/modules/inapp-notifications/inapp-notification-manager.ts +40 -0
  323. package/src/acmo/modules/inapp-notifications/limited-time-offer/components/limited-time-offer-card.tsx +188 -0
  324. package/src/acmo/modules/inapp-notifications/limited-time-offer/limited-time-notif.tsx +149 -0
  325. package/src/acmo/modules/inapp-notifications/repository.ts +49 -0
  326. package/src/acmo/modules/inapp-notifications/tyrads-global-host.tsx +25 -0
  327. package/src/acmo/modules/{dashboard → premium-widgets}/components/custom_card.tsx +1 -2
  328. package/src/acmo/modules/{dashboard → premium-widgets}/components/custom_scroller.tsx +24 -10
  329. package/src/acmo/modules/{dashboard → premium-widgets}/components/offer_card.tsx +11 -11
  330. package/src/acmo/modules/{dashboard → premium-widgets}/components/offer_list_item.tsx +3 -3
  331. package/src/acmo/modules/{dashboard → premium-widgets}/components/premium_loading.tsx +1 -1
  332. package/src/acmo/modules/premium-widgets/controller.ts +39 -0
  333. package/src/acmo/modules/{dashboard/top_offers.tsx → premium-widgets/premium_offers_widget.tsx} +67 -45
  334. package/src/acmo/modules/premium-widgets/premium_offers_widget_wrapper.tsx +39 -0
  335. package/src/acmo/modules/premium-widgets/repository.ts +107 -0
  336. package/src/acmo/modules/push-notifications/apns-manager.ts +254 -0
  337. package/src/acmo/modules/push-notifications/fcm-manager.ts +162 -0
  338. package/src/acmo_config.ts +6 -5
  339. package/src/assets/images/alarm-clock.png +0 -0
  340. package/src/assets/images/circle-x.png +0 -0
  341. package/src/assets/images/coin.png +0 -0
  342. package/src/index.tsx +19 -127
  343. package/ios/Tyrads/user/AcmoUserUpdatePage.swift +0 -302
  344. package/ios/Tyrads/user/AcmoUsersUpdateController.swift +0 -26
  345. package/ios/Tyrads/user/Repository.swift +0 -89
  346. package/lib/commonjs/acmo/core/helpers/native_methods.js +0 -48
  347. package/lib/commonjs/acmo/core/helpers/native_methods.js.map +0 -1
  348. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +0 -1
  349. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +0 -1
  350. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +0 -1
  351. package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +0 -1
  352. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +0 -1
  353. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +0 -1
  354. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +0 -1
  355. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +0 -1
  356. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +0 -1
  357. package/lib/commonjs/acmo/modules/dashboard/repository.js +0 -147
  358. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +0 -1
  359. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +0 -1
  360. package/lib/module/acmo/core/helpers/native_methods.js +0 -44
  361. package/lib/module/acmo/core/helpers/native_methods.js.map +0 -1
  362. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +0 -1
  363. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +0 -1
  364. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +0 -1
  365. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +0 -1
  366. package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +0 -1
  367. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +0 -1
  368. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +0 -1
  369. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +0 -1
  370. package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +0 -1
  371. package/lib/module/acmo/modules/dashboard/repository.js +0 -140
  372. package/lib/module/acmo/modules/dashboard/repository.js.map +0 -1
  373. package/lib/module/acmo/modules/dashboard/top_offers.js.map +0 -1
  374. package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +0 -10
  375. package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +0 -1
  376. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +0 -1
  377. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +0 -1
  378. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +0 -1
  379. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +0 -1
  380. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +0 -1
  381. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +0 -1
  382. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +0 -1
  383. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +0 -1
  384. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +0 -1
  385. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +0 -3
  386. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +0 -1
  387. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +0 -1
  388. package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +0 -10
  389. package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +0 -1
  390. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +0 -1
  391. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +0 -1
  392. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +0 -1
  393. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +0 -1
  394. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +0 -1
  395. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +0 -1
  396. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +0 -1
  397. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +0 -1
  398. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +0 -1
  399. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +0 -3
  400. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +0 -1
  401. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +0 -1
  402. package/src/acmo/core/helpers/native_methods.ts +0 -59
  403. package/src/acmo/modules/dashboard/repository.ts +0 -170
  404. /package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/active_offers_button.js +0 -0
  405. /package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/custom_shimmer.js +0 -0
  406. /package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/premium_empty_widget.js +0 -0
  407. /package/lib/commonjs/acmo/modules/{dashboard → premium-widgets}/components/premium_header.js +0 -0
  408. /package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/active_offers_button.js +0 -0
  409. /package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/custom_shimmer.js +0 -0
  410. /package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/premium_empty_widget.js +0 -0
  411. /package/lib/module/acmo/modules/{dashboard → premium-widgets}/components/premium_header.js +0 -0
  412. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/active_offers_button.d.ts +0 -0
  413. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/custom_card.d.ts +0 -0
  414. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/custom_shimmer.d.ts +0 -0
  415. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/offer_card.d.ts +0 -0
  416. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/offer_list_item.d.ts +0 -0
  417. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/premium_empty_widget.d.ts +0 -0
  418. /package/lib/typescript/commonjs/src/acmo/modules/{dashboard → premium-widgets}/components/premium_header.d.ts +0 -0
  419. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/active_offers_button.d.ts +0 -0
  420. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/custom_card.d.ts +0 -0
  421. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/custom_shimmer.d.ts +0 -0
  422. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/offer_card.d.ts +0 -0
  423. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/offer_list_item.d.ts +0 -0
  424. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/premium_empty_widget.d.ts +0 -0
  425. /package/lib/typescript/module/src/acmo/modules/{dashboard → premium-widgets}/components/premium_header.d.ts +0 -0
  426. /package/src/acmo/modules/{dashboard → premium-widgets}/components/active_offers_button.tsx +0 -0
  427. /package/src/acmo/modules/{dashboard → premium-widgets}/components/custom_shimmer.tsx +0 -0
  428. /package/src/acmo/modules/{dashboard → premium-widgets}/components/premium_empty_widget.tsx +0 -0
  429. /package/src/acmo/modules/{dashboard → premium-widgets}/components/premium_header.tsx +0 -0
@@ -0,0 +1,149 @@
1
+ import type React from "react";
2
+ import { useEffect, useState } from "react";
3
+ import { Dimensions, StyleSheet, Text, View } from "react-native";
4
+ import InAppNotificationController from "../controller";
5
+ import { CardAlert } from "../components/modal-wrapper";
6
+ import { CardGradient } from "../components/gradient_card";
7
+ import { Logger } from "../../../core/helpers/logger";
8
+ import { LimitedTimeOfferCard } from "./components/limited-time-offer-card";
9
+ import SnapCarousel from "../../../core/components/snap-carousel";
10
+ import NotificationManager from "../inapp-notification-manager";
11
+ import TyradsSdkCoreMethods from "../../../core/tyrads-sdk-core";
12
+
13
+
14
+ const SCREEN_WIDTH = Dimensions.get('window').width
15
+ interface InAppNotifProps {
16
+ useModal?: boolean;
17
+ }
18
+
19
+ export const LimitedTimeEventsNotif: React.FC<InAppNotifProps> = ({ useModal = true }) => {
20
+
21
+ const [visible, setVisible] = useState(false);
22
+ const [limitedTimeEvents, setLimitedTimeEvents] = useState<ActivatedCampaign[] | null>([]);
23
+ const controller = InAppNotificationController.getInstance();
24
+ const notificationManager = NotificationManager.getInstance();
25
+
26
+ useEffect(() => {
27
+ const updateFromController = () => {
28
+ if (controller.limitedTimeEvents) {
29
+ const limitedTimeEventsArray = controller.limitedTimeEvents;
30
+ Logger.log('limitedTimeEvents', limitedTimeEventsArray)
31
+ setLimitedTimeEvents(limitedTimeEventsArray);
32
+ } else {
33
+ setLimitedTimeEvents(null);
34
+ }
35
+ };
36
+
37
+ updateFromController();
38
+ const unsubscribe = controller.addListener(updateFromController);
39
+ return unsubscribe;
40
+ }, []);
41
+
42
+ useEffect(() => {
43
+ const hasEvents = limitedTimeEvents?.length !== undefined && limitedTimeEvents?.length > 0;
44
+
45
+ if (hasEvents) {
46
+ notificationManager.setLimitedTimeVisible(true);
47
+ setVisible(true);
48
+ controller.markLimitedTimeOffersAsShown();
49
+ } else {
50
+ notificationManager.setLimitedTimeVisible(false);
51
+ }
52
+ }, [limitedTimeEvents]);
53
+
54
+ const handleClose = () => {
55
+ setVisible(false);
56
+ notificationManager.setLimitedTimeVisible(false);
57
+ if (!useModal) {
58
+ TyradsSdkCoreMethods.dismissInAppNotification();
59
+ }
60
+ };
61
+
62
+ return (
63
+ <CardAlert visible={visible} onClose={handleClose} useModal={useModal}>
64
+ <CardGradient onClose={handleClose}>
65
+ <Text style={styles.title}>{"Limited Time Offer"}</Text>
66
+ <View style={styles.horizontalLine} />
67
+ <Text style={styles.text}>Limited time offer unlocked! Play now and claim extra rewards!</Text>
68
+ <SnapCarousel
69
+ data={limitedTimeEvents!}
70
+ renderItem={({ item, index }: { item: ActivatedCampaign; index: number }) => (
71
+ <View key={index} style={{ paddingHorizontal: 6 }}>
72
+
73
+ <LimitedTimeOfferCard
74
+ activatedCampaign={item}
75
+ />
76
+ </View>
77
+ )}
78
+ sliderWidth={(SCREEN_WIDTH * 0.9) - 32}
79
+ itemWidth={limitedTimeEvents?.length == 1 ? (SCREEN_WIDTH * 0.82) : (SCREEN_WIDTH * 0.65)}
80
+ loop={false}
81
+ paginationContainerStyle={{
82
+ marginTop: 16,
83
+ paddingVertical: 0,
84
+ }}
85
+ autoplay
86
+ />
87
+ </CardGradient>
88
+ </CardAlert>
89
+ );
90
+ };
91
+
92
+
93
+ const styles = StyleSheet.create({
94
+ title: {
95
+ fontSize: 16,
96
+ fontWeight: '700',
97
+ color: '#1E2020',
98
+ textAlign: 'center',
99
+ marginTop: 20,
100
+ },
101
+ horizontalLine: {
102
+ width: '100%',
103
+ borderBottomColor: '#E0E2E7',
104
+ borderBottomWidth: 1,
105
+ marginVertical: 16,
106
+ },
107
+ text: {
108
+ fontSize: 12,
109
+ fontWeight: '400',
110
+ color: '#1E2020',
111
+ textAlign: 'center',
112
+ marginBottom: 16,
113
+ },
114
+ timerContainer: {
115
+ flexDirection: 'row',
116
+ justifyContent: 'center',
117
+ alignItems: 'center',
118
+ marginBottom: 16,
119
+ backgroundColor: "#FF554A",
120
+ paddingVertical: 4,
121
+ borderRadius: 20,
122
+ },
123
+ timer: {
124
+ fontSize: 12,
125
+ fontWeight: '700',
126
+ color: '#FFFFFF',
127
+ },
128
+ timerMessage: {
129
+ fontSize: 12,
130
+ fontWeight: '700',
131
+ color: '#FFFFFF',
132
+ marginLeft: 8,
133
+ },
134
+ outlinedButton: {
135
+ borderWidth: 2,
136
+ borderRadius: 30,
137
+ justifyContent: 'center',
138
+ height: 42,
139
+ },
140
+ outlinedButtonTextContainer: {
141
+ justifyContent: 'center',
142
+ alignItems: 'center',
143
+ },
144
+ outlinedButtonText: {
145
+ color: '#02B5BE',
146
+ fontSize: 14,
147
+ fontWeight: '600',
148
+ },
149
+ });
@@ -0,0 +1,49 @@
1
+ import { http } from '../../core/network/http-client';
2
+ import { Logger } from '../../core/helpers/logger';
3
+ import AcmoAPIEndpoints from '../../core/constants/api-endpoints';
4
+
5
+ class InAppNotificationRepo {
6
+ private static instance: InAppNotificationRepo;
7
+
8
+ public static getInstance(): InAppNotificationRepo {
9
+ if (!InAppNotificationRepo.instance) {
10
+ InAppNotificationRepo.instance = new InAppNotificationRepo();
11
+ }
12
+ return InAppNotificationRepo.instance;
13
+ }
14
+
15
+ async fetchLimitedTimeOffers(): Promise<ActivatedCampaignsResponse | null> {
16
+
17
+ try {
18
+ const { status, data } = await http.get(
19
+ AcmoAPIEndpoints.ACTIVE_CAMPAIGNS,
20
+ );
21
+ Logger.log(status, data)
22
+ if (status === 200) {
23
+ return data as ActivatedCampaignsResponse;
24
+ }
25
+ return null
26
+ } catch (err) {
27
+ Logger.error(err)
28
+ return null
29
+ }
30
+ }
31
+ async fetchCurrencySales(): Promise<CurrencySales | null> {
32
+ try {
33
+ const { status, data } = await http.get(
34
+ AcmoAPIEndpoints.ENGAGEMENT,
35
+ );
36
+ Logger.log(status, data)
37
+ if (status === 200) {
38
+ return data.data.CurrencySales as CurrencySales;
39
+ }
40
+ return null
41
+ } catch (err) {
42
+ Logger.error(err)
43
+ return null
44
+ }
45
+ }
46
+
47
+ }
48
+
49
+ export default InAppNotificationRepo;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { LocalizationProvider } from "../localization/localization_context";
4
+ import InAppNotificationHost from "./inapp-notification-host";
5
+
6
+ const TyradsGlobalHost: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
7
+ return (
8
+ <View style={{ flex: 1 }}>
9
+ {children}
10
+ <View style={styles.overlay} pointerEvents="box-none">
11
+ <LocalizationProvider>
12
+ <InAppNotificationHost useModal={true} />
13
+ </LocalizationProvider>
14
+ </View>
15
+ </View>
16
+ );
17
+ };
18
+
19
+ const styles = StyleSheet.create({
20
+ overlay: {
21
+ ...StyleSheet.absoluteFillObject,
22
+ },
23
+ });
24
+
25
+ export default TyradsGlobalHost;
@@ -13,9 +13,8 @@ const CustomCard: React.FC<CustomCardProps> = ({ children, style }) => {
13
13
  const styles = StyleSheet.create({
14
14
  card: {
15
15
  backgroundColor: 'white',
16
+ width: '100%',
16
17
  borderRadius: 16,
17
- paddingTop: 6,
18
- paddingBottom: 5,
19
18
  shadowColor: '#000',
20
19
  alignSelf: 'center',
21
20
  shadowOffset: { width: 0, height: 2 },
@@ -19,6 +19,9 @@ interface PagerProps {
19
19
  indicatorStyle?: StyleProp<ViewStyle>;
20
20
  activeIndicatorColor?: string;
21
21
  inactiveIndicatorColor?: string;
22
+ inactiveOpacity?: number;
23
+ inactiveScaleFactor?: number;
24
+ autoPlay?: boolean;
22
25
  }
23
26
 
24
27
  const AcmoScrollPager: React.FC<PagerProps> = ({
@@ -31,6 +34,9 @@ const AcmoScrollPager: React.FC<PagerProps> = ({
31
34
  indicatorStyle,
32
35
  activeIndicatorColor = 'red',
33
36
  inactiveIndicatorColor = 'lightgray',
37
+ inactiveOpacity = 0.3,
38
+ inactiveScaleFactor = 0.8,
39
+ autoPlay = true,
34
40
  }) => {
35
41
  const scrollX = useRef(new Animated.Value(0)).current;
36
42
  const scrollViewRef = useRef<React.RefObject<typeof Animated.ScrollView> | any>(null);
@@ -50,19 +56,20 @@ const AcmoScrollPager: React.FC<PagerProps> = ({
50
56
  const itemWidth = containerWidth * viewportFraction;
51
57
  const offset = itemWidth + spacing;
52
58
 
53
- intervalRef.current = setInterval(() => {
54
- const next = (currentPage + 1) % totalPages;
55
- setCurrentPage(next);
56
- scrollViewRef.current.scrollTo({
57
- x: next * offset,
58
- animated: true,
59
- });
60
- }, delayInMillis);
61
-
59
+ if (autoPlay) {
60
+ intervalRef.current = setInterval(() => {
61
+ const next = (currentPage + 1) % totalPages;
62
+ setCurrentPage(next);
63
+ scrollViewRef.current.scrollTo({
64
+ x: next * offset,
65
+ animated: true,
66
+ });
67
+ }, delayInMillis);
68
+ }
62
69
  return () => {
63
70
  if (intervalRef.current) clearInterval(intervalRef.current);
64
71
  };
65
- }, [containerWidth, currentPage, delayInMillis, totalPages, viewportFraction, spacing]);
72
+ }, [containerWidth, currentPage, delayInMillis, totalPages, viewportFraction, spacing, autoPlay]);
66
73
 
67
74
  const handleScroll = Animated.event(
68
75
  [{ nativeEvent: { contentOffset: { x: scrollX } } }],
@@ -87,6 +94,12 @@ const AcmoScrollPager: React.FC<PagerProps> = ({
87
94
  {
88
95
  backgroundColor:
89
96
  i === currentPage ? activeIndicatorColor : inactiveIndicatorColor,
97
+ opacity: i === currentPage ? 1 : inactiveOpacity,
98
+ transform: [
99
+ {
100
+ scale: i === currentPage ? scaleFactor : inactiveScaleFactor,
101
+ },
102
+ ],
90
103
  },
91
104
  ]}
92
105
  />
@@ -162,3 +175,4 @@ const styles = StyleSheet.create({
162
175
  });
163
176
 
164
177
  export default AcmoScrollPager;
178
+
@@ -53,7 +53,7 @@ const AcmoOfferCard: React.FC<Props> = ({
53
53
  source={{ uri: item.creative.creativePacks[0]?.creatives[0]?.fileUrl || '' }}
54
54
  style={styles.image}
55
55
  />
56
- {item.premium && (
56
+ {item.campaignPremium && (
57
57
  <View style={styles.diamondIcon}>
58
58
  <Image
59
59
  style={{ width: 12, height: 12, objectFit: 'contain', tintColor: 'white' }}
@@ -71,13 +71,13 @@ const AcmoOfferCard: React.FC<Props> = ({
71
71
  <View style={styles.payoutSection}>
72
72
  {currencySaleModel?.multiplier && (
73
73
  <Text style={styles.strikePayout}>
74
- {numeral(item.campaignPayout.totalPlayablePayoutConverted)}
74
+ {numeral((Object.values(item.payoutSummary)[0] as PayoutSummary)?.totalPlayablePayoutConverted || 0)}
75
75
  </Text>
76
76
  )}
77
77
  <View style={styles.payoutRow}>
78
- <Image source={{ uri: item.currency.adUnitCurrencyIcon }} style={styles.currencyIcon} />
78
+ <Image source={{ uri: (Object.values(item.availableCurrencies)[0] as AvailableCurrency)?.currencyIcon || '' }} style={styles.currencyIcon} />
79
79
  <Text style={styles.payoutText}>
80
- {numeral(item.campaignPayout.totalPlayablePayoutConverted * bonusMultiplier)}
80
+ {numeral(((Object.values(item.payoutSummary)[0] as PayoutSummary)?.totalPlayablePayoutConverted || 0) * bonusMultiplier)}
81
81
  </Text>
82
82
  </View>
83
83
  </View>
@@ -117,17 +117,17 @@ const AcmoOfferCard: React.FC<Props> = ({
117
117
 
118
118
  const styles = StyleSheet.create({
119
119
  container: {
120
- margin: 16,
121
- width: "100%"
122
- },
123
- cardShadow: {
124
- borderRadius: 16,
125
- backgroundColor: 'white',
120
+ width: "100%",
121
+ marginBottom: 16,
126
122
  shadowColor: 'black',
127
123
  shadowOffset: { width: 0, height: 16 },
128
124
  shadowOpacity: 0.06,
129
125
  shadowRadius: 18,
130
- elevation: 4,
126
+ },
127
+ cardShadow: {
128
+ borderRadius: 16,
129
+ backgroundColor: 'white',
130
+ elevation: 5,
131
131
  },
132
132
  imageContainer: {
133
133
  borderTopLeftRadius: 16,
@@ -77,18 +77,18 @@ export const AcmoOfferListItem: React.FC<Props> = ({
77
77
  <View style={styles.payoutRow}>
78
78
  {currencySales && (
79
79
  <Text style={styles.strikeText}>
80
- {numeral(offer.campaignPayout.totalPlayablePayoutConverted)}
80
+ {numeral(Object.values(offer.payoutSummary)[0]?.totalPlayablePayoutConverted || 0)}
81
81
  </Text>
82
82
  )}
83
83
 
84
84
  <Image
85
- source={{ uri: offer.currency.adUnitCurrencyIcon }}
85
+ source={{ uri: (Object.values(offer.availableCurrencies)[0] as AvailableCurrency)?.currencyIcon || '' }}
86
86
  style={styles.currencyIcon}
87
87
  />
88
88
 
89
89
  <Text style={styles.payoutText}>
90
90
  {numeral(
91
- offer.campaignPayout.totalPlayablePayoutConverted * bonusMultiplier
91
+ ((Object.values(offer.payoutSummary)[0] as PayoutSummary)?.totalPlayablePayoutConverted || 0) * bonusMultiplier
92
92
  )}
93
93
  </Text>
94
94
  </View>
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
3
  import Shimmer from './custom_shimmer';
4
- import { PremiumWidgetStyles } from '../top_offers';
4
+ import { PremiumWidgetStyles } from '../premium_offers_widget';
5
5
  import CustomCard from './custom_card';
6
6
 
7
7
  interface PremiumWidgetsLoadingProps {
@@ -0,0 +1,39 @@
1
+
2
+ import repository from './repository';
3
+
4
+ class PremiumWidgetsController {
5
+ private static instance: PremiumWidgetsController;
6
+
7
+ private constructor() { }
8
+
9
+ public static getInstance(): PremiumWidgetsController {
10
+ if (!PremiumWidgetsController.instance) {
11
+ PremiumWidgetsController.instance = new PremiumWidgetsController();
12
+ }
13
+ return PremiumWidgetsController.instance;
14
+ }
15
+
16
+ public async getPremiums(): Promise<{
17
+ campaigns: Campaign[];
18
+ currencySales: CurrencySales;
19
+ summary: number;
20
+ }> {
21
+ const [campaigns, currencySales, summary] = await Promise.all([
22
+ repository.fetchTargetedCampaigns(),
23
+ repository.fetchCurrencySales(),
24
+ repository.fetchSummary(),
25
+ ]);
26
+
27
+ return {
28
+ campaigns,
29
+ currencySales,
30
+ summary,
31
+ };
32
+ }
33
+
34
+ public async openOffer(campaign: Campaign) {
35
+ await repository.openOffer(campaign);
36
+ }
37
+ }
38
+
39
+ export default PremiumWidgetsController.getInstance();
@@ -3,17 +3,18 @@ import {
3
3
  View,
4
4
  Text,
5
5
  StyleSheet,
6
+ Dimensions,
6
7
  } from 'react-native';
7
- import { fetchPremiumOfferDetails, openOffer } from './repository';
8
+ import controller from './controller';
8
9
  import PremiumHeaderSection from './components/premium_header';
9
10
  import CustomCard from './components/custom_card';
10
11
  import ActiveOffersButton from './components/active_offers_button';
11
12
  import { AcmoOfferListItem } from './components/offer_list_item';
12
13
  import AcmoOfferCard from './components/offer_card';
13
- import AcmoScrollPager from './components/custom_scroller';
14
14
  import PremiumEmptyView from './components/premium_empty_widget';
15
15
  import PremiumWidgetsLoading from './components/premium_loading';
16
- import TyradsNativeMethods from '../../core/helpers/native_methods';
16
+ import TyradsSdkCore from '../../core/tyrads-sdk-core';
17
+ import SnapCarousel from '../../core/components/snap-carousel';
17
18
 
18
19
  export const enum PremiumWidgetStyles {
19
20
  list,
@@ -25,7 +26,8 @@ interface PremiumWidgetProps {
25
26
  onNavigate: (route?: string, campaignID?: number) => void;
26
27
  }
27
28
 
28
- const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
29
+ const SCREEN_WIDTH = Dimensions.get('window').width;
30
+ const PremiumOffersWidget: React.FC<PremiumWidgetProps> = ({
29
31
  widgetStyle = PremiumWidgetStyles.list,
30
32
  onNavigate
31
33
  }) => {
@@ -37,16 +39,24 @@ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
37
39
  const [activeCount, setActiveCount] = useState<number>(0);
38
40
  const [loadingIndex, setLoadingIndex] = useState<number | null>(null);
39
41
 
40
- useEffect(() => {
41
- fetchPremiumOfferDetails(
42
- setPremiumColor,
43
- setCampaigns,
44
- setCurrencySale,
45
- setActiveCount,
46
- setError,
47
- setIsLoading,
48
- );
42
+ const fetchPremiumOffers = async () => {
43
+ setIsLoading(true);
44
+ setError(null);
45
+ try {
46
+ const data = await controller.getPremiums();
47
+ setCampaigns(data.campaigns);
48
+ setCurrencySale(data.currencySales);
49
+ setPremiumColor(TyradsSdkCore.premiumColor || '#1C90DF');
50
+ setActiveCount(data.summary);
51
+ } catch (e: any) {
52
+ setError(e.message || 'Something went wrong');
53
+ } finally {
54
+ setIsLoading(false);
55
+ }
56
+ };
49
57
 
58
+ useEffect(() => {
59
+ fetchPremiumOffers();
50
60
  }, []);
51
61
 
52
62
  const handleShowOffers = () => {
@@ -61,10 +71,10 @@ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
61
71
  };
62
72
 
63
73
  const handleButtonPress = async (campaign: Campaign) => {
64
- let isReady = await TyradsNativeMethods.isPrivacyAccepted()
74
+ let isReady = await TyradsSdkCore.isPrivacyAccepted()
65
75
  if (!isReady) {
66
76
  try {
67
- const result = await TyradsNativeMethods.checkOnboardingProcess();
77
+ const result = await TyradsSdkCore.checkOnboardingProcess();
68
78
  console.log("Privacy flow result:", result);
69
79
  isReady = result === true;
70
80
  } catch (err) {
@@ -75,22 +85,18 @@ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
75
85
  if (!isReady) {
76
86
  return
77
87
  }
78
- await openOffer(campaign);
79
- await fetchPremiumOfferDetails(
80
- setPremiumColor,
81
- setCampaigns,
82
- setCurrencySale,
83
- setActiveCount,
84
- setError,
85
- setIsLoading,
86
- );
88
+ await controller.openOffer(campaign);
89
+ await fetchPremiumOffers();
87
90
  }
88
91
 
92
+
89
93
  if (isLoading) {
90
94
  return (
91
- <PremiumWidgetsLoading
92
- widgetStyle={widgetStyle}
93
- />
95
+ <>
96
+ <PremiumWidgetsLoading
97
+ widgetStyle={widgetStyle}
98
+ />
99
+ </>
94
100
  );
95
101
  }
96
102
 
@@ -104,14 +110,16 @@ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
104
110
 
105
111
 
106
112
  if (campaigns.length === 0) {
107
- return <PremiumEmptyView
108
- colorPremium={premiumColor}
109
- onContinue={handleShowOffers}
110
- />
113
+ return <>
114
+ <PremiumEmptyView
115
+ colorPremium={premiumColor}
116
+ onContinue={handleShowOffers}
117
+ />
118
+ </>;
111
119
  }
112
120
 
113
121
  return (
114
- <CustomCard style={{ flexDirection: 'row' }}>
122
+ <CustomCard>
115
123
  <View style={{ flex: 1 }}>
116
124
  <PremiumHeaderSection premiumColor={premiumColor} onShowOffers={handleShowOffers} />
117
125
  <View style={styles.headerSpacer} />
@@ -135,19 +143,33 @@ const PremiumWidgets: React.FC<PremiumWidgetProps> = ({
135
143
  );
136
144
  case PremiumWidgetStyles.sliderCards:
137
145
  return (
138
- <AcmoScrollPager
139
- totalPages={campaigns.length}
140
- activeIndicatorColor={premiumColor}
141
- content={(index) => (
142
- <AcmoOfferCard
143
- item={campaigns[index]!}
144
- onButtonClick={async () => handleButtonPress(campaigns[index]!)}
145
- currencySaleModel={currencySale}
146
- premiumColor={premiumColor}
147
- isLoading={false}
148
- onTap={async () => handleCampaignPress && handleCampaignPress(campaigns[index]!.campaignId)}
149
- />
146
+ <SnapCarousel
147
+ data={campaigns}
148
+ renderItem={({ item, index }) => (
149
+ <View style={{ paddingHorizontal: 16 }}>
150
+ <AcmoOfferCard
151
+ item={item}
152
+ onButtonClick={async () => handleButtonPress(campaigns[index]!)}
153
+ currencySaleModel={currencySale}
154
+ premiumColor={premiumColor}
155
+ isLoading={false}
156
+ onTap={async () => handleCampaignPress && handleCampaignPress(campaigns[index]!.campaignId)}
157
+ />
158
+ </View>
150
159
  )}
160
+ sliderWidth={SCREEN_WIDTH - 40}
161
+ itemWidth={SCREEN_WIDTH - 40}
162
+ dotStyle={{
163
+ marginVertical: 0,
164
+ backgroundColor: premiumColor || "#000"
165
+ }}
166
+ paginationContainerStyle={{
167
+ marginBottom: 16,
168
+ marginTop: 8,
169
+ paddingVertical: 0,
170
+ }}
171
+ loop
172
+ autoplay
151
173
  />
152
174
  );
153
175
  default:
@@ -193,4 +215,4 @@ const styles = StyleSheet.create({
193
215
  },
194
216
  });
195
217
 
196
- export default PremiumWidgets;
218
+ export default PremiumOffersWidget;
@@ -0,0 +1,39 @@
1
+ import { View } from 'react-native';
2
+ import { LocalizationProvider } from '../localization/localization_context';
3
+ import TyradsSdkCore from '../../core/tyrads-sdk-core';
4
+ import BasePremiumOffersWidget, { PremiumWidgetStyles } from './premium_offers_widget';
5
+ import PremiumWidgetsLoading from './components/premium_loading';
6
+
7
+ export const PremiumOffersWidget = ({
8
+ widgetStyle = PremiumWidgetStyles.list,
9
+ launchMode = 2,
10
+ }: {
11
+ widgetStyle?: PremiumWidgetStyles;
12
+ launchMode?: number;
13
+ }) => {
14
+ const handleNavigation = (route?: string, campaignID?: number | null) => {
15
+ TyradsSdkCore.showOffers({ route: route, campaignID: campaignID, launchMode: launchMode });
16
+ };
17
+ return (
18
+ <LocalizationProvider>
19
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
20
+ <BasePremiumOffersWidget
21
+ widgetStyle={widgetStyle}
22
+ onNavigate={handleNavigation}
23
+ />
24
+ </View>
25
+ </LocalizationProvider>
26
+ );
27
+ };
28
+
29
+ export const PremiumOffersWidgetLoading = (
30
+ { widgetStyle = PremiumWidgetStyles.list }: {
31
+ widgetStyle?: PremiumWidgetStyles;
32
+ }
33
+ ) => {
34
+ return (
35
+ <PremiumWidgetsLoading
36
+ widgetStyle={widgetStyle}
37
+ />
38
+ );
39
+ };