@tyrads.com/tyrads-sdk 3.3.4-beta.0 → 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 +6 -4
  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,59 @@
1
+ import React from 'react';
2
+ import { Modal, Pressable, View, StyleSheet } from 'react-native';
3
+
4
+ interface CardAlertProps {
5
+ visible: boolean;
6
+ onClose: () => void;
7
+ children?: React.ReactNode;
8
+ useModal?: boolean;
9
+ }
10
+
11
+ export const CardAlert: React.FC<CardAlertProps> = ({
12
+ visible,
13
+ onClose,
14
+ children,
15
+ useModal = true,
16
+ }) => {
17
+ const content = (
18
+ <View style={styles.fullscreen}>
19
+ <Pressable style={styles.overlay} onPress={onClose} />
20
+ <View style={styles.card}>
21
+ {children}
22
+ </View>
23
+ </View>
24
+ );
25
+
26
+ if (!useModal) {
27
+ return visible ? content : null;
28
+ }
29
+
30
+ return (
31
+ <Modal
32
+ animationType="fade"
33
+ transparent={true}
34
+ visible={visible}
35
+ onRequestClose={onClose}
36
+ >
37
+ {content}
38
+ </Modal>
39
+ );
40
+ };
41
+
42
+ const styles = StyleSheet.create({
43
+ fullscreen: {
44
+ flex: 1,
45
+ justifyContent: 'center',
46
+ alignItems: 'center',
47
+ },
48
+
49
+ overlay: {
50
+ ...StyleSheet.absoluteFillObject,
51
+ backgroundColor: 'rgba(0,0,0,0.5)',
52
+ },
53
+
54
+ card: {
55
+ width: '100%',
56
+ alignItems: 'center',
57
+ zIndex: 10,
58
+ },
59
+ });
@@ -0,0 +1,183 @@
1
+ import InAppNotificationRepo from "./repository";
2
+ import { getData, saveData } from "../../core/storage/storage";
3
+ import AsyncStorage from "@react-native-async-storage/async-storage";
4
+
5
+ class InAppNotificationController {
6
+ private static instance: InAppNotificationController | null = null;
7
+ private constructor() { }
8
+
9
+ public static getInstance(): InAppNotificationController {
10
+ if (!InAppNotificationController.instance) {
11
+ InAppNotificationController.instance = new InAppNotificationController();
12
+ }
13
+ return InAppNotificationController.instance;
14
+ }
15
+
16
+ public currencySales: CurrencySales | null = null;
17
+ public limitedTimeEvents: Array<ActivatedCampaign> | null = null;
18
+ private listeners: Array<() => void> = [];
19
+
20
+ public addListener(listener: () => void): () => void {
21
+ this.listeners.push(listener);
22
+ return () => {
23
+ this.listeners = this.listeners.filter(l => l !== listener);
24
+ };
25
+ }
26
+
27
+ private notifyListeners() {
28
+ this.listeners.forEach(l => l());
29
+ }
30
+
31
+ private async getUserId(): Promise<string> {
32
+ try {
33
+ const userId = await getData<string>('xUserId');
34
+ if (userId) return userId;
35
+
36
+ const data = await AsyncStorage.getItem('apiHeaders');
37
+ if (!data) return 'default';
38
+ const parsed = JSON.parse(data);
39
+ const headers = typeof parsed === 'string' ? JSON.parse(parsed) : parsed;
40
+ return headers['xUserId'] || 'default';
41
+ } catch {
42
+ return 'default';
43
+ }
44
+ }
45
+
46
+ private async getCurrencySalesKey(): Promise<string> {
47
+ const userId = await this.getUserId();
48
+ return `currency_sales_shown_${userId}`;
49
+ }
50
+
51
+ private async getLimitedTimeOffersKey(): Promise<string> {
52
+ const userId = await this.getUserId();
53
+ return `limited_time_offers_shown_${userId}`;
54
+ }
55
+
56
+ private getTodayDateString(): string {
57
+ return new Date().toDateString();
58
+ }
59
+
60
+ public async markCurrencySalesAsShown() {
61
+ if (!this.currencySales?.name) return;
62
+ const key = await this.getCurrencySalesKey();
63
+ const shownData = await getData<any>(key) || {};
64
+ const safeShownData = (typeof shownData === 'object' && shownData !== null) ? shownData : {};
65
+ safeShownData[this.currencySales.name] = this.getTodayDateString();
66
+ await saveData(key, safeShownData);
67
+ }
68
+
69
+ public async markLimitedTimeOffersAsShown() {
70
+ if (!this.limitedTimeEvents) return;
71
+ const key = await this.getLimitedTimeOffersKey();
72
+ const shownData = await getData<any>(key) || {};
73
+ const safeShownData = (typeof shownData === 'object' && shownData !== null) ? shownData : {};
74
+ const today = this.getTodayDateString();
75
+ this.limitedTimeEvents.forEach(campaign => {
76
+ campaign.limitedTimeEvents.forEach(event => {
77
+ safeShownData[event.appEventId.toString()] = today;
78
+ });
79
+ });
80
+ await saveData(key, safeShownData);
81
+ }
82
+
83
+ public async init() {
84
+ const [currencySalesKey, limitedTimeOffersKey] = await Promise.all([
85
+ this.getCurrencySalesKey(),
86
+ this.getLimitedTimeOffersKey(),
87
+ ]);
88
+
89
+ const [currencySalesShownData, limitedTimeOffersShownData] = await Promise.all([
90
+ getData<Record<string, string>>(currencySalesKey),
91
+ getData<Record<string, string>>(limitedTimeOffersKey),
92
+ ]);
93
+
94
+ const today = this.getTodayDateString();
95
+
96
+ const isCurrencyShownToday = currencySalesShownData && Object.values(currencySalesShownData).includes(today);
97
+ const isLimitedShownToday = limitedTimeOffersShownData && Object.values(limitedTimeOffersShownData).includes(today);
98
+
99
+ const [currencySalesResult, limitedTimeOffersResult] = await Promise.all([
100
+ !isCurrencyShownToday
101
+ ? InAppNotificationRepo.getInstance().fetchCurrencySales()
102
+ : Promise.resolve(null),
103
+ !isLimitedShownToday
104
+ ? InAppNotificationRepo.getInstance().fetchLimitedTimeOffers()
105
+ : Promise.resolve(null),
106
+ ]);
107
+
108
+ if (currencySalesResult && currencySalesResult.name) {
109
+ const hasBeenShownEver = currencySalesShownData && !!currencySalesShownData[currencySalesResult.name];
110
+ this.currencySales = !hasBeenShownEver ? currencySalesResult : null;
111
+ } else {
112
+ this.currencySales = null;
113
+ }
114
+
115
+ const activeOffers = limitedTimeOffersResult?.data || [];
116
+ const allFilteredOffers = this.filterLimitedOffersWithEvents(activeOffers);
117
+
118
+ const hasNewEvent = allFilteredOffers.some(campaign =>
119
+ campaign.limitedTimeEvents.some(event =>
120
+ !limitedTimeOffersShownData || !limitedTimeOffersShownData[event.appEventId.toString()]
121
+ )
122
+ );
123
+
124
+ if (hasNewEvent) {
125
+ this.limitedTimeEvents = allFilteredOffers;
126
+ } else if (!this.limitedTimeEvents) {
127
+ this.limitedTimeEvents = null;
128
+ }
129
+ this.notifyListeners();
130
+ return !!(this.currencySales || this.limitedTimeEvents);
131
+ }
132
+ private filterLimitedOffersWithEvents(
133
+ activeOffers: ActivatedCampaignsData[]
134
+ ): ActivatedCampaign[] {
135
+ const allCampaigns = activeOffers
136
+ .filter(group => group.groupName?.toLowerCase() == "hotdeals")
137
+ .flatMap(offer => offer.campaigns)
138
+ .filter(campaign => campaign.limitedTimeEvents.length > 0)
139
+ .filter(campaign =>
140
+ campaign.campaignStatus?.toLowerCase() !== 'suspended' &&
141
+ campaign.validity?.isInstalled
142
+ )
143
+ .filter(campaign =>
144
+ campaign.limitedTimeEvents.some(event =>
145
+ event.conversionStatus?.toLowerCase() !== "approved"
146
+ )
147
+ );
148
+ const uniqueCampaigns = allCampaigns.filter((campaign, index, self) =>
149
+ index === self.findIndex((c) => c.campaignId === campaign.campaignId)
150
+ );
151
+ return uniqueCampaigns;
152
+ }
153
+
154
+ public showCountdown(event: LimitedTimeEvent): boolean {
155
+ const { allowDuplicateEvents, conversionStatus, dailyCount, dailyLimit } = event;
156
+ const isDailyLimitIncomplete = dailyCount === null || dailyLimit === null || dailyCount < dailyLimit;
157
+
158
+ if (!allowDuplicateEvents) {
159
+ return conversionStatus === null;
160
+ }
161
+ if (isDailyLimitIncomplete) {
162
+ return true;
163
+ }
164
+ return false;
165
+ }
166
+
167
+ public getFinalStatusString(event: LimitedTimeEvent): 'Completed' | 'Rejected' | '' {
168
+ const { allowDuplicateEvents, conversionStatus, dailyCount, dailyLimit } = event;
169
+ if (!allowDuplicateEvents) {
170
+ if (conversionStatus === 'approved') return 'Completed';
171
+ if (conversionStatus === 'rejected') return 'Rejected';
172
+ }
173
+
174
+ const isDailyLimitComplete = dailyCount !== null && dailyLimit !== null && dailyCount === dailyLimit;
175
+ if (allowDuplicateEvents && isDailyLimitComplete) {
176
+ return 'Completed';
177
+ }
178
+ return '';
179
+ }
180
+
181
+ }
182
+
183
+ export default InAppNotificationController;
@@ -0,0 +1,164 @@
1
+ import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
2
+ import { CardAlert } from "../components/modal-wrapper";
3
+ import { useEffect, useState } from "react";
4
+ import { CardGradient } from "../components/gradient_card";
5
+ import { CountdownTimer } from "../../../core/components/countdown-timer";
6
+ import TyradsSdkCoreMethods, { TyradsSdkCore } from "../../../core/tyrads-sdk-core";
7
+ import InAppNotificationController from "../controller";
8
+ import NotificationManager from "../inapp-notification-manager";
9
+
10
+ interface InAppNotifProps {
11
+ useModal?: boolean;
12
+ }
13
+
14
+ export const CurrencySalesNotif: React.FC<InAppNotifProps> = ({ useModal = true }) => {
15
+
16
+ const [visible, setVisible] = useState(false);
17
+ const [currencySales, setCurrencySales] = useState<CurrencySales | null>(null);
18
+ const controller = InAppNotificationController.getInstance();
19
+ const notificationManager = NotificationManager.getInstance();
20
+
21
+ useEffect(() => {
22
+ const updateFromController = () => {
23
+ if (controller.currencySales) {
24
+ setCurrencySales(controller.currencySales);
25
+ } else {
26
+ setCurrencySales(null);
27
+ }
28
+ };
29
+
30
+ updateFromController();
31
+ const unsubscribe = controller.addListener(updateFromController);
32
+ return unsubscribe;
33
+ }, []);
34
+
35
+ useEffect(() => {
36
+ const unsubscribe = notificationManager.addListener(() => {
37
+ updateVisibility();
38
+ });
39
+
40
+ return unsubscribe;
41
+ }, []);
42
+
43
+ useEffect(() => {
44
+ if (currencySales) {
45
+ notificationManager.setCurrencySalesVisible(true);
46
+ updateVisibility();
47
+ } else {
48
+ notificationManager.setCurrencySalesVisible(false);
49
+ }
50
+ }, [currencySales]);
51
+
52
+ const updateVisibility = () => {
53
+ const shouldShow = notificationManager.shouldShowCurrencySales();
54
+ setVisible(shouldShow);
55
+ if (shouldShow) {
56
+ controller.markCurrencySalesAsShown();
57
+ }
58
+ };
59
+
60
+ const handleClose = () => {
61
+ setVisible(false);
62
+ notificationManager.setCurrencySalesVisible(false);
63
+ if (!useModal) {
64
+ TyradsSdkCoreMethods.dismissInAppNotification();
65
+ }
66
+ };
67
+
68
+ const handleButtonPress = () => {
69
+ handleClose();
70
+ setTimeout(() => {
71
+ TyradsSdkCoreMethods.showOffers({ launchMode: 2 });
72
+ }, 400)
73
+ };
74
+
75
+ return (
76
+ <CardAlert visible={visible} onClose={handleClose} useModal={useModal}>
77
+ <CardGradient onClose={handleClose}>
78
+ <Text style={styles.title}>{"Bonus Rewards \nUnlocked!"}</Text>
79
+ <View style={styles.horizontalLine} />
80
+ <Text style={styles.subtitle}>{`You get ${currencySales?.multiplier}X bonus rewards!`}</Text>
81
+ <Text style={styles.text}>Go to offerwall and activate new offer!</Text>
82
+ {
83
+ <View style={styles.timerContainer}>
84
+ <Text style={styles.timerMessage}>Bonus Expires in </Text>
85
+ <CountdownTimer style={styles.timer} duration={currencySales?.remainingTimeSeconds ?? 0}></CountdownTimer>
86
+ </View>
87
+ }
88
+ <TouchableOpacity
89
+ style={[styles.outlinedButton, { borderColor: TyradsSdkCore.getInstance().mainColor || "#02B5BE", backgroundColor: "white" }]}
90
+ onPress={handleButtonPress}
91
+ activeOpacity={0.8}
92
+ >
93
+ <View style={styles.outlinedButtonTextContainer}>
94
+ <Text style={[styles.outlinedButtonText, { color: TyradsSdkCore.getInstance().mainColor || "#02B5BE" }]}>Go to Offerwall</Text>
95
+ </View>
96
+ </TouchableOpacity>
97
+ </CardGradient>
98
+ </CardAlert>
99
+ )
100
+ };
101
+
102
+ const styles = StyleSheet.create({
103
+ title: {
104
+ fontSize: 16,
105
+ fontWeight: '700',
106
+ color: '#1E2020',
107
+ textAlign: 'center',
108
+ marginTop: 20,
109
+ },
110
+ horizontalLine: {
111
+ width: '100%',
112
+ borderBottomColor: '#E0E2E7',
113
+ borderBottomWidth: 1,
114
+ marginVertical: 16,
115
+ },
116
+ subtitle: {
117
+ fontSize: 12,
118
+ fontWeight: '700',
119
+ color: '#1E2020',
120
+ textAlign: 'center',
121
+ },
122
+ text: {
123
+ fontSize: 12,
124
+ fontWeight: '400',
125
+ color: '#1E2020',
126
+ textAlign: 'center',
127
+ marginBottom: 16,
128
+ },
129
+ timerContainer: {
130
+ flexDirection: 'row',
131
+ justifyContent: 'center',
132
+ alignItems: 'center',
133
+ marginBottom: 16,
134
+ backgroundColor: "#FF554A",
135
+ paddingVertical: 4,
136
+ borderRadius: 20,
137
+ },
138
+ timer: {
139
+ fontSize: 12,
140
+ fontWeight: '700',
141
+ color: '#FFFFFF',
142
+ },
143
+ timerMessage: {
144
+ fontSize: 12,
145
+ fontWeight: '700',
146
+ color: '#FFFFFF',
147
+ marginLeft: 8,
148
+ },
149
+ outlinedButton: {
150
+ borderWidth: 2,
151
+ borderRadius: 30,
152
+ justifyContent: 'center',
153
+ height: 42,
154
+ },
155
+ outlinedButtonTextContainer: {
156
+ justifyContent: 'center',
157
+ alignItems: 'center',
158
+ },
159
+ outlinedButtonText: {
160
+ color: '#02B5BE',
161
+ fontSize: 14,
162
+ fontWeight: '600',
163
+ },
164
+ });
@@ -0,0 +1,32 @@
1
+ import { View } from "react-native";
2
+ import { CurrencySalesNotif } from "./currency-sales/currency-sales-notif";
3
+ import { LimitedTimeEventsNotif } from "./limited-time-offer/limited-time-notif";
4
+ import { useEffect } from "react";
5
+ import InAppNotificationController from "./controller";
6
+
7
+ import TyradsSdkCoreMethods from "../../core/tyrads-sdk-core";
8
+
9
+ interface InAppNotificationHostProps {
10
+ useModal?: boolean;
11
+ style?: any;
12
+ }
13
+
14
+ const InAppNotificationHost: React.FC<InAppNotificationHostProps> = ({ useModal = true, style }) => {
15
+ useEffect(() => {
16
+ const initializeInAppNotifications = async () => {
17
+ if (TyradsSdkCoreMethods.apiKey) {
18
+ await InAppNotificationController.getInstance().init();
19
+ }
20
+ }
21
+ initializeInAppNotifications();
22
+ }, [])
23
+
24
+ return (
25
+ <View style={style}>
26
+ <CurrencySalesNotif useModal={useModal} />
27
+ <LimitedTimeEventsNotif useModal={useModal} />
28
+ </View>
29
+ );
30
+ }
31
+
32
+ export default InAppNotificationHost
@@ -0,0 +1,40 @@
1
+ class NotificationManager {
2
+ private static instance: NotificationManager;
3
+ private limitedTimeVisible = false;
4
+ private currencySalesVisible = false;
5
+ private listeners: Array<() => void> = [];
6
+
7
+ static getInstance(): NotificationManager {
8
+ if (!NotificationManager.instance) {
9
+ NotificationManager.instance = new NotificationManager();
10
+ }
11
+ return NotificationManager.instance;
12
+ }
13
+
14
+ setLimitedTimeVisible(visible: boolean) {
15
+ this.limitedTimeVisible = visible;
16
+ this.notifyListeners();
17
+ }
18
+
19
+ setCurrencySalesVisible(visible: boolean) {
20
+ this.currencySalesVisible = visible;
21
+ this.notifyListeners();
22
+ }
23
+
24
+ shouldShowCurrencySales(): boolean {
25
+ return this.currencySalesVisible && !this.limitedTimeVisible;
26
+ }
27
+
28
+ addListener(listener: () => void): () => void {
29
+ this.listeners.push(listener);
30
+ return () => {
31
+ this.listeners = this.listeners.filter(l => l !== listener);
32
+ };
33
+ }
34
+
35
+ private notifyListeners() {
36
+ this.listeners.forEach(listener => listener());
37
+ }
38
+ }
39
+
40
+ export default NotificationManager;
@@ -0,0 +1,188 @@
1
+ import { useEffect } from "react"
2
+ import { FlatList, Image, StyleSheet, Text, TouchableOpacity, View } from "react-native"
3
+ import { Logger } from "../../../../core/helpers/logger"
4
+ import { numeral } from "../../../../core/helpers/numeral"
5
+ import { CountdownTimer } from "../../../../core/components/countdown-timer"
6
+ import InAppNotificationController from "../../controller"
7
+ import { acmoLaunchURL } from "../../../../core/helpers/launcher"
8
+ import { TyradsSdkCore } from "../../../../core/tyrads-sdk-core"
9
+ import { getContrastColor } from "../../../../core/helpers/colors"
10
+
11
+ export const LimitedTimeOfferCard: React.FC<{ activatedCampaign: ActivatedCampaign | null }> = ({ activatedCampaign }) => {
12
+
13
+ const controller = InAppNotificationController.getInstance();
14
+
15
+ useEffect(() => {
16
+ Logger.log('activatedCampaign in offer card', activatedCampaign)
17
+ })
18
+
19
+ const handleButtonPress = (link: string) => {
20
+ acmoLaunchURL(link);
21
+ }
22
+
23
+ return <View style={styles.container}>
24
+ <Image
25
+ source={require('../../../../../assets/images/alarm-clock.png')}
26
+ style={styles.bgImage}
27
+ />
28
+ <View style={styles.appHeader}>
29
+ <Image
30
+ source={{ uri: activatedCampaign?.app.thumbnail }}
31
+ style={styles.thumbnail}
32
+ />
33
+ <Text style={styles.appName}>
34
+ {activatedCampaign?.app.title}
35
+ </Text>
36
+ </View>
37
+ <FlatList
38
+ data={activatedCampaign?.limitedTimeEvents || []}
39
+ keyExtractor={(_, index) => index.toString()}
40
+ renderItem={({ item: event, index }) => (
41
+ <View key={index}
42
+ style={styles.eventContainer}>
43
+ <View style={styles.eventNameContainer}>
44
+ <Text style={styles.eventName}>
45
+ {event.eventName}
46
+ </Text>
47
+ <View style={styles.eventPayoutRow}>
48
+ <Image style={styles.eventCurrencyIcon}
49
+ source={{ uri: Object.values(activatedCampaign?.availableCurrencies || {})[0]?.currencyIcon }}
50
+ />
51
+ <Text style={[styles.eventPayout, { color: TyradsSdkCore.getInstance().mainColor || '#02B5BE' }]}>
52
+ {numeral(Object.values(event.payoutInfo || {})[0]?.payoutAmountConverted ?? 0)}
53
+ </Text>
54
+ </View>
55
+ </View>
56
+ {
57
+ !controller.showCountdown(event)
58
+ ?
59
+ <Text
60
+ style={[
61
+ styles.eventStatus,
62
+ { color: event.conversionStatus == 'approved' ? '#A3A9B6' : '#FF554A' }
63
+ ]}>
64
+ {controller.getFinalStatusString(event)}
65
+ </Text>
66
+ :
67
+ <View style={styles.timerContainer}>
68
+ <CountdownTimer
69
+ style={styles.timer}
70
+ duration={event.limitedTimeEventRemainingSeconds}
71
+ />
72
+ </View>
73
+ }
74
+ </View>
75
+ )}
76
+ style={styles.eventsContainer}
77
+ showsVerticalScrollIndicator={false}
78
+ nestedScrollEnabled={true}
79
+ />
80
+ <TouchableOpacity style={[styles.filledButton, { backgroundColor: TyradsSdkCore.getInstance().mainColor || "#02B5BE", }]}
81
+ onPress={() => handleButtonPress(activatedCampaign?.app.previewUrl || '')}
82
+ activeOpacity={0.8}
83
+ >
84
+ <Text style={[styles.btnText, { color: getContrastColor(TyradsSdkCore.getInstance().mainColor || "white") }]}>Play Now</Text>
85
+ </TouchableOpacity>
86
+ </View>
87
+ }
88
+
89
+ const styles = StyleSheet.create({
90
+ container: {
91
+ position: 'relative',
92
+ borderRadius: 16,
93
+ width: '100%',
94
+ maxWidth: '100%',
95
+ height: 378,
96
+ padding: 16,
97
+ backgroundColor: '#FFF9ED',
98
+ overflow: 'hidden',
99
+ },
100
+ bgImage: {
101
+ position: 'absolute',
102
+ right: 0,
103
+ bottom: 0,
104
+ },
105
+ thumbnail: {
106
+ width: 43,
107
+ height: 43,
108
+ borderRadius: 7,
109
+ marginRight: 13
110
+ },
111
+ appHeader: {
112
+ flexDirection: 'row',
113
+ alignItems: 'center',
114
+ marginBottom: 16,
115
+ },
116
+ appName: {
117
+ width: '75%',
118
+ fontSize: 12,
119
+ fontWeight: '600',
120
+ color: '#1E2020',
121
+ marginRight: 16,
122
+ },
123
+ eventsContainer: {
124
+ maxHeight: 350
125
+ },
126
+ eventContainer: {
127
+ flexDirection: 'row',
128
+ backgroundColor: 'white',
129
+ paddingVertical: 8,
130
+ paddingHorizontal: 16,
131
+ alignItems: 'center',
132
+ justifyContent: 'space-between',
133
+ borderRadius: 8,
134
+ marginBottom: 16,
135
+ shadowColor: '#000',
136
+ shadowOffset: { width: 0, height: 8 },
137
+ shadowOpacity: 0.06,
138
+ shadowRadius: 10,
139
+ },
140
+ eventNameContainer: {
141
+ width: '58%',
142
+ marginRight: 8,
143
+ },
144
+ eventName: {
145
+ fontSize: 12,
146
+ color: '#1E2020',
147
+ },
148
+ eventPayoutRow: {
149
+ flexDirection: 'row',
150
+ alignItems: 'center',
151
+ marginTop: 4
152
+ },
153
+ eventCurrencyIcon: {
154
+ width: 12,
155
+ height: 12,
156
+ marginRight: 4,
157
+ resizeMode: 'contain',
158
+ },
159
+ eventPayout: {
160
+ fontSize: 12,
161
+ fontWeight: '700',
162
+ },
163
+ eventStatus: {
164
+ fontSize: 10,
165
+ fontWeight: '600',
166
+ },
167
+ timerContainer: {
168
+ backgroundColor: '#FF554A',
169
+ paddingVertical: 2,
170
+ paddingHorizontal: 8,
171
+ borderRadius: 10,
172
+ },
173
+ timer: {
174
+ fontSize: 12,
175
+ fontWeight: '700',
176
+ color: 'white'
177
+ },
178
+ filledButton: {
179
+ borderRadius: 8,
180
+ paddingVertical: 12,
181
+ alignItems: 'center',
182
+ },
183
+ btnText: {
184
+ fontSize: 12,
185
+ fontWeight: '600',
186
+ color: 'white'
187
+ }
188
+ })