@tyrads.com/tyrads-sdk 3.0.0-beta.0 → 3.2.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 (289) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +130 -29
  3. package/ios/Tyrads/AcmoAssets.swift +14 -0
  4. package/ios/Tyrads/ApiHeaders.swift +1 -0
  5. package/ios/Tyrads/InitModel.swift +3 -0
  6. package/ios/Tyrads/Tyrads.swift +255 -213
  7. package/ios/Tyrads/WebViewController.swift +195 -0
  8. package/ios/Tyrads/core/utils/AcmoKeyNames.swift +29 -0
  9. package/ios/Tyrads/core/utils/ColorExtension.swift +55 -0
  10. package/ios/Tyrads/core/utils/Services/LocalizationService.swift +175 -0
  11. package/ios/Tyrads/helpers/device_details.swift +160 -0
  12. package/ios/Tyrads/legal/AcmoPrivacyPage.swift +353 -0
  13. package/ios/Tyrads/legal/PrivacyPageController.swift +31 -0
  14. package/ios/Tyrads/user/AcmoUserUpdatePage.swift +302 -0
  15. package/ios/Tyrads/user/AcmoUsersUpdateController.swift +26 -0
  16. package/ios/Tyrads/user/Repository.swift +89 -0
  17. package/ios/TyradsSdk.mm +22 -4
  18. package/ios/TyradsSdk.swift +101 -31
  19. package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
  20. package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
  21. package/lib/commonjs/acmo/core/helpers/native_methods.js +37 -0
  22. package/lib/commonjs/acmo/core/helpers/native_methods.js.map +1 -0
  23. package/lib/commonjs/acmo/core/helpers/numeral.js +19 -0
  24. package/lib/commonjs/acmo/core/helpers/numeral.js.map +1 -0
  25. package/lib/commonjs/acmo/core/services/localization_service.js +164 -0
  26. package/lib/commonjs/acmo/core/services/localization_service.js.map +1 -0
  27. package/lib/commonjs/acmo/core/storage/storage.js +15 -1
  28. package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
  29. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +79 -0
  30. package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  31. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
  32. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  33. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
  34. package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  35. package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
  36. package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  37. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +263 -0
  38. package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  39. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +203 -0
  40. package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  41. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +87 -0
  42. package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  43. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +16 -14
  44. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  45. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +111 -0
  46. package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  47. package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
  48. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  49. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +85 -63
  50. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  51. package/lib/commonjs/acmo/modules/localization/localization_context.js +56 -0
  52. package/lib/commonjs/acmo/modules/localization/localization_context.js.map +1 -0
  53. package/lib/commonjs/assets/images/angle_up.png +0 -0
  54. package/lib/commonjs/assets/images/diamond.png +0 -0
  55. package/lib/commonjs/assets/images/info.png +0 -0
  56. package/lib/commonjs/assets/images/info_icon.png +0 -0
  57. package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
  58. package/lib/commonjs/assets/images/rank_1.png +0 -0
  59. package/lib/commonjs/assets/images/rank_2.png +0 -0
  60. package/lib/commonjs/assets/images/rank_3.png +0 -0
  61. package/lib/commonjs/assets/images/rank_4.png +0 -0
  62. package/lib/commonjs/assets/images/rank_5.png +0 -0
  63. package/lib/commonjs/index.js +50 -16
  64. package/lib/commonjs/index.js.map +1 -1
  65. package/lib/module/acmo/core/helpers/launcher.js +15 -0
  66. package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
  67. package/lib/module/acmo/core/helpers/native_methods.js +33 -0
  68. package/lib/module/acmo/core/helpers/native_methods.js.map +1 -0
  69. package/lib/module/acmo/core/helpers/numeral.js +14 -0
  70. package/lib/module/acmo/core/helpers/numeral.js.map +1 -0
  71. package/lib/module/acmo/core/services/localization_service.js +159 -0
  72. package/lib/module/acmo/core/services/localization_service.js.map +1 -0
  73. package/lib/module/acmo/core/storage/storage.js +13 -0
  74. package/lib/module/acmo/core/storage/storage.js.map +1 -1
  75. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +73 -0
  76. package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
  77. package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
  78. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  79. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
  80. package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
  81. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
  82. package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
  83. package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
  84. package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
  85. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +197 -0
  86. package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
  87. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +82 -0
  88. package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
  89. package/lib/module/acmo/modules/dashboard/components/premium_header.js +16 -14
  90. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  91. package/lib/module/acmo/modules/dashboard/components/premium_loading.js +106 -0
  92. package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
  93. package/lib/module/acmo/modules/dashboard/repository.js +105 -30
  94. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  95. package/lib/module/acmo/modules/dashboard/top_offers.js +86 -64
  96. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  97. package/lib/module/acmo/modules/localization/localization_context.js +45 -0
  98. package/lib/module/acmo/modules/localization/localization_context.js.map +1 -0
  99. package/lib/module/assets/images/angle_up.png +0 -0
  100. package/lib/module/assets/images/diamond.png +0 -0
  101. package/lib/module/assets/images/info.png +0 -0
  102. package/lib/module/assets/images/info_icon.png +0 -0
  103. package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
  104. package/lib/module/assets/images/rank_1.png +0 -0
  105. package/lib/module/assets/images/rank_2.png +0 -0
  106. package/lib/module/assets/images/rank_3.png +0 -0
  107. package/lib/module/assets/images/rank_4.png +0 -0
  108. package/lib/module/assets/images/rank_5.png +0 -0
  109. package/lib/module/index.js +49 -17
  110. package/lib/module/index.js.map +1 -1
  111. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
  112. package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +6 -0
  114. package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts +2 -0
  116. package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts +18 -0
  118. package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +1 -0
  120. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  122. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  125. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  127. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  129. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  131. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  133. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
  136. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
  138. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  140. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts +14 -0
  142. package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/index.d.ts +8 -6
  144. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  145. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
  146. package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
  147. package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +6 -0
  148. package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
  149. package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts +2 -0
  150. package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts.map +1 -0
  151. package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts +18 -0
  152. package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts.map +1 -0
  153. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +1 -0
  154. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  155. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
  156. package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
  157. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
  158. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
  159. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
  160. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
  161. package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
  162. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
  163. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
  164. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
  165. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
  166. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
  167. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
  168. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  169. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
  170. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
  171. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
  172. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  173. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
  174. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  175. package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts +14 -0
  176. package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
  177. package/lib/typescript/module/src/index.d.ts +8 -6
  178. package/lib/typescript/module/src/index.d.ts.map +1 -1
  179. package/package.json +3 -6
  180. package/readme.md +8 -8
  181. package/src/acmo/core/helpers/launcher.ts +14 -0
  182. package/src/acmo/core/helpers/native_methods.ts +43 -0
  183. package/src/acmo/core/helpers/numeral.ts +14 -0
  184. package/src/acmo/core/services/localization_service.ts +200 -0
  185. package/src/acmo/core/storage/storage.ts +14 -0
  186. package/src/acmo/core/types/types.d.ts +11 -13
  187. package/src/acmo/modules/dashboard/components/active_offers_button.tsx +62 -0
  188. package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
  189. package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
  190. package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
  191. package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
  192. package/src/acmo/modules/dashboard/components/offer_list_item.tsx +228 -0
  193. package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +79 -0
  194. package/src/acmo/modules/dashboard/components/premium_header.tsx +14 -13
  195. package/src/acmo/modules/dashboard/components/premium_loading.tsx +72 -0
  196. package/src/acmo/modules/dashboard/repository.ts +121 -46
  197. package/src/acmo/modules/dashboard/top_offers.tsx +105 -53
  198. package/src/acmo/modules/localization/localization_context.tsx +52 -0
  199. package/src/assets/images/angle_up.png +0 -0
  200. package/src/assets/images/diamond.png +0 -0
  201. package/src/assets/images/info.png +0 -0
  202. package/src/assets/images/info_icon.png +0 -0
  203. package/src/assets/images/premium-emptybg.jpeg +0 -0
  204. package/src/assets/images/rank_1.png +0 -0
  205. package/src/assets/images/rank_2.png +0 -0
  206. package/src/assets/images/rank_3.png +0 -0
  207. package/src/assets/images/rank_4.png +0 -0
  208. package/src/assets/images/rank_5.png +0 -0
  209. package/src/index.tsx +76 -34
  210. package/lib/commonjs/acmo/core/marquee.js.map +0 -1
  211. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
  212. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  213. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
  214. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  215. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
  216. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  217. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -180
  218. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  219. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
  220. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  221. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
  222. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  223. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
  224. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  225. package/lib/commonjs/i18n.js +0 -112
  226. package/lib/commonjs/i18n.js.map +0 -1
  227. package/lib/module/acmo/core/marquee.js +0 -54
  228. package/lib/module/acmo/core/marquee.js.map +0 -1
  229. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
  230. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
  231. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
  232. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
  233. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
  234. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
  235. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -174
  236. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
  237. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
  238. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
  239. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
  240. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
  241. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
  242. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
  243. package/lib/module/i18n.js +0 -107
  244. package/lib/module/i18n.js.map +0 -1
  245. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
  246. package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
  247. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  248. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  249. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  250. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  251. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  252. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  253. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  254. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  255. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  256. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  257. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  258. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  259. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  260. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  261. package/lib/typescript/commonjs/src/i18n.d.ts +0 -3
  262. package/lib/typescript/commonjs/src/i18n.d.ts.map +0 -1
  263. package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
  264. package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
  265. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
  266. package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
  267. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
  268. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
  269. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
  270. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
  271. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
  272. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
  273. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
  274. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
  275. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
  276. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
  277. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
  278. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
  279. package/lib/typescript/module/src/i18n.d.ts +0 -3
  280. package/lib/typescript/module/src/i18n.d.ts.map +0 -1
  281. package/src/acmo/core/marquee.tsx +0 -62
  282. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
  283. package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
  284. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
  285. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -163
  286. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
  287. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
  288. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
  289. package/src/i18n.ts +0 -115
@@ -3,7 +3,7 @@ import UIKit
3
3
  import AppTrackingTransparency
4
4
  import AdSupport
5
5
  import WebKit
6
-
6
+ import Combine
7
7
 
8
8
 
9
9
  /// The TyradsSdk class provides methods for configuring the SDK and displaying offers.
@@ -11,14 +11,25 @@ public class Tyrads : NSObject {
11
11
  /// Shared instance of the TyradsSdk.
12
12
  public static let instance = Tyrads()
13
13
 
14
- private var apiKey: String = ""
15
- private var apiSecret: String = ""
16
- private var encKey: String?
17
- private var publisherUserID: String = ""
18
- private var currentLanguage: String = "en"
19
- private var newUser: Bool = false
14
+ internal var apiKey: String = ""
15
+ internal var apiSecret: String = ""
16
+ internal var encKey: String?
17
+ internal var publisherUserID: String = ""
18
+ internal var mainColor: String?
19
+ private var token: String = ""
20
+ internal var currentLanguage: String = "en" {
21
+ didSet {
22
+ if oldValue != currentLanguage {
23
+ languagePublisher.send(currentLanguage)
24
+ }
25
+ }
26
+ }
27
+
28
+ public let languagePublisher = PassthroughSubject<String, Never>()
29
+ internal var newUser: Bool = false
20
30
  private var loginData: AcmoInitModel?
21
31
  var initializationWait = DispatchSemaphore(value: 0)
32
+ private var initializationContinuation: CheckedContinuation<Void, Never>?
22
33
  private var debugMode: Bool = false
23
34
 
24
35
  private var _isSecure: Bool = false
@@ -28,259 +39,290 @@ public class Tyrads : NSObject {
28
39
  }
29
40
  }
30
41
 
31
- private func log(_ message: String) {
42
+ internal func log(_ message: String) {
32
43
  if debugMode {
33
44
  NSLog(message)
34
45
  }
35
46
  }
47
+
48
+ private func ensureInitialized() async {
49
+ guard self.token.isEmpty else { return }
50
+
51
+ await withCheckedContinuation { continuation in
52
+ self.initializationContinuation = continuation
53
+ }
54
+ }
36
55
 
37
56
  /// Configures the Tyrads SDK with the provided API key and secret key.
38
57
  ///
39
58
  /// - Parameters:
40
59
  /// - apiKey: The API key provided by Tyrads.
41
60
  /// - secretKey: The secret key provided by Tyrads.
42
- @objc public func configure( apiKey: String, secretKey: String, encKey: String? = nil, debugMode: Bool = false) {
61
+ @objc public func configure( apiKey: String, secretKey: String, encKey: String? = nil, debugMode: Bool = false) async -> String {
43
62
  self.apiKey = apiKey
44
63
  self.apiSecret = secretKey
45
64
  self.encKey = encKey
46
65
  self._isSecure = (encKey != nil)
47
66
  self.debugMode = debugMode
48
- self.currentLanguage = Locale.current.languageCode ?? ""
67
+
68
+ let savedLocale = UserDefaults.standard.string(forKey: "locale")
69
+ let deviceLocale = Locale.current.languageCode ?? "en"
70
+ self.currentLanguage = savedLocale ?? deviceLocale
71
+ await LocalizationService.shared.initialize(locale: self.currentLanguage)
72
+ return self.currentLanguage
49
73
  }
50
74
 
51
75
  /// Logs in the user with the provided user ID or retrieves the user ID from UserDefaults.
52
76
  ///
53
77
  /// - Parameter userID: Optional. The user ID to log in with. If nil, the SDK will attempt to retrieve the user ID from UserDefaults.
54
- public func loginUser(_ userID: String? = nil, completion: @escaping (ApiHeaders?) -> Void) {
78
+ public func loginUser(_ userID: String? = nil) async throws -> ApiHeaders? {
55
79
  let userId = userID ?? UserDefaults.standard.string(forKey: "acmo-tyrads-sdk-user-id") ?? ""
56
-
57
- let identifierType = "IDFA"
80
+ var identifierType = "IDFA"
58
81
  var advertisingId = ""
59
-
60
- func finalizeLogin() {
61
- let fd: [String: Any] = [
62
- "publisherUserId": userId,
63
- "platform": "iOS",
64
- "identifierType": identifierType,
65
- "identifier": advertisingId
66
- ]
67
-
68
- self.log("Initializing with data: \(fd)")
69
-
70
- guard let url = URL(string: AcmoConfig.BASE_URL + "initialize") else {
71
- self.log("Failed to create URL")
72
- completion(nil)
73
- return
74
- }
75
-
76
- var request = URLRequest(url: url)
77
- request.httpMethod = "POST"
78
- request.setValue(AcmoConfig.SDK_PLATFORM, forHTTPHeaderField: "X-SDK-Platform")
79
- request.setValue(AcmoConfig.SDK_VERSION, forHTTPHeaderField: "X-SDK-Version")
80
- request.setValue("application/json", forHTTPHeaderField: "Content-Type")
81
- request.setValue(self.apiKey, forHTTPHeaderField: "X-API-Key")
82
- request.setValue(self.apiSecret, forHTTPHeaderField: "X-API-Secret")
83
- request.setValue(_isSecure ? "BASIC" : "PLAIN", forHTTPHeaderField: "X-Secure-Mode")
84
-
85
- do {
86
- let requestBody = _isSecure && !(encKey ?? "").isEmpty
87
- ? try AcmoEncrypt(encKey!).encryptDataAESGCM(data: fd)
88
- : fd
89
-
90
- print("Req Body: \(requestBody)")
91
-
92
- request.httpBody = try JSONSerialization.data(withJSONObject: requestBody)
93
- } catch {
94
- self.log("Failed to serialize request body: \(error)")
95
- completion(nil)
96
- return
97
- }
98
-
99
- let task = URLSession.shared.dataTask(with: request) { data, response, error in
100
- if let error = error {
101
- self.log("Network request failed: \(error)")
102
- completion(nil)
103
- return
104
- }
105
-
106
- guard let data = data else {
107
- self.log("No data received from the server")
108
- completion(nil)
109
- return
110
- }
111
-
112
- if let responseString = String(data: data, encoding: .utf8) {
113
- self.log("Received response: \(responseString)")
114
-
115
- guard let jsonData = responseString.data(using: .utf8),
116
- let acmoInitModel = try? JSONDecoder().decode(AcmoInitModel.self, from: jsonData) else {
117
- self.log("Failed to decode response")
118
- completion(nil)
119
- return
120
- }
121
-
122
- self.loginData = acmoInitModel
123
- self.publisherUserID = acmoInitModel.data.user.publisherUserId
124
- self.newUser = acmoInitModel.data.newRegisteredUser
125
- self.log("Login successful. Publisher User ID: \(self.publisherUserID), New User: \(self.newUser)")
126
- self.initializationWait.signal()
127
-
128
- // Build ApiHeaders object
129
- let headers = ApiHeaders(
130
- xApiKey: self.apiKey,
131
- xApiSecret: self.apiSecret,
132
- xUserId: self.publisherUserID,
133
- xSdkPlatform: AcmoConfig.SDK_PLATFORM,
134
- xSdkVersion: AcmoConfig.SDK_VERSION,
135
- userAgent: UIDevice.current.systemName + "/" + UIDevice.current.systemVersion,
136
- languageCode: Locale.current.languageCode ?? "en",
137
- premiumColor: acmoInitModel.data.publisherApp.premiumColor,
138
- headerColor: acmoInitModel.data.publisherApp.headerColor,
139
- mainColor: acmoInitModel.data.publisherApp.mainColor
140
- )
141
-
142
- completion(headers)
143
- }
144
- }
145
-
146
- task.resume()
147
- self.log("Network request started")
148
- }
82
+ let deviceDetails = getDeviceDetails()
149
83
 
150
84
  if #available(iOS 14, *) {
151
85
  self.log("Requesting tracking authorization for iOS 14+")
152
- ATTrackingManager.requestTrackingAuthorization { status in
153
- switch status {
154
- case .authorized:
155
- advertisingId = ASIdentifierManager.shared().advertisingIdentifier.uuidString
156
- self.log("Tracking authorized. Advertising ID: \(advertisingId)")
157
- case .denied, .restricted, .notDetermined:
158
- advertisingId = ""
159
- self.log("Tracking not authorized or restricted")
160
- @unknown default:
161
- self.log("Unknown tracking status")
162
- }
163
- finalizeLogin()
86
+ let status = await ATTrackingManager.requestTrackingAuthorization()
87
+ switch status {
88
+ case .authorized:
89
+ advertisingId = ASIdentifierManager.shared().advertisingIdentifier.uuidString
90
+ self.log("Tracking authorized. Advertising ID: \(advertisingId)")
91
+ case .denied, .restricted, .notDetermined:
92
+ advertisingId = "\(deviceDetails["deviceId"] ?? UUID().uuidString)"
93
+ identifierType = "OTHER"
94
+ self.log("Tracking not authorized or restricted")
95
+ @unknown default:
96
+ self.log("Unknown tracking status")
164
97
  }
165
98
  } else {
166
99
  advertisingId = ASIdentifierManager.shared().advertisingIdentifier.uuidString
167
100
  self.log("iOS version < 14. Advertising ID: \(advertisingId)")
168
- finalizeLogin()
169
101
  }
170
- }
171
-
172
102
 
103
+ let fd: [String: Any] = [
104
+ "publisherUserId": userId,
105
+ "platform": "iOS",
106
+ "identifierType": identifierType,
107
+ "identifier": advertisingId,
108
+ "deviceData": deviceDetails
109
+ ]
173
110
 
174
-
175
- public func showOffers(_ launchMode: Int = 3, route: String? = nil, campaignID: Int? = nil) {
176
- self.initializationWait.wait()
177
- var campaignIDString: String = "0"
178
- if let campaignIDValue = campaignID {
179
- campaignIDString = String(campaignIDValue)
111
+ self.log("Initializing with data: \(fd)")
112
+ guard let url = URL(string: AcmoConfig.BASE_URL + "initialize") else {
113
+ self.log("Failed to create URL")
114
+ throw NSError(domain: "TyradsSdk", code: 1, userInfo: [NSLocalizedDescriptionKey: "Invalid URL"])
180
115
  }
181
- let urlString =
182
- "https://websdk.tyrads.com/?apiKey=\(Tyrads.instance.apiKey)&apiSecret=\(Tyrads.instance.apiSecret)&encKey=\(Tyrads.instance.encKey ?? "")&userID=\(Tyrads.instance.publisherUserID)&newUser=\(Tyrads.instance.newUser)&platform=\(AcmoConfig.SDK_PLATFORM)&hc=\(Tyrads.instance.loginData?.data.publisherApp.headerColor ?? "")&mc=\(Tyrads.instance.loginData?.data.publisherApp.mainColor ?? "")&pc=\(Tyrads.instance.loginData?.data.publisherApp.premiumColor ?? "")&launchMode=\(launchMode)&route=\(route ?? "")&campaignID=\(campaignIDString)&lang=\(Tyrads.instance.currentLanguage)&av=\(AcmoConfig.ACMO_VERSION)&sdkVersion=\(AcmoConfig.SDK_VERSION)"
183
116
 
117
+ var request = URLRequest(url: url)
118
+ request.httpMethod = "POST"
119
+ request.setValue(AcmoConfig.SDK_PLATFORM, forHTTPHeaderField: "X-SDK-Platform")
120
+ request.setValue(AcmoConfig.SDK_VERSION, forHTTPHeaderField: "X-SDK-Version")
121
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
122
+ request.setValue(self.apiKey, forHTTPHeaderField: "X-API-Key")
123
+ request.setValue(self.apiSecret, forHTTPHeaderField: "X-API-Secret")
124
+ request.setValue(_isSecure ? "BASIC" : "PLAIN", forHTTPHeaderField: "X-Secure-Mode")
125
+
184
126
  do {
185
- guard let url = URL(string: urlString) else {
186
- throw NSError(domain: "TyradsSdk", code: 1, userInfo: [NSLocalizedDescriptionKey: "Invalid URL"])
187
- }
188
-
189
- switch launchMode {
190
- case 1, 2:
191
- DispatchQueue.main.async {
192
- let config = WKWebViewConfiguration()
193
- let userContentController = WKUserContentController()
194
-
195
- userContentController.add(self, name: "clickHandler")
196
- config.userContentController = userContentController
197
-
198
- let webView = WKWebView(frame: UIScreen.main.bounds, configuration: config)
199
- webView.navigationDelegate = self
200
-
201
- if #available(iOS 16.4, *) {
202
- webView.isInspectable = true
203
- }
204
-
205
- let viewController = UIViewController()
206
- viewController.view = webView
207
- viewController.modalPresentationStyle = .fullScreen
208
-
209
- webView.load(URLRequest(url: url))
210
-
211
- if let rootViewController = UIApplication.shared.windows.first?.rootViewController {
212
- rootViewController.present(viewController, animated: true, completion: nil)
213
- }
214
- }
215
- case 3:
216
- DispatchQueue.main.async {
217
- UIApplication.shared.open(url, options: [:], completionHandler: nil)
218
- }
219
- default:
220
- DispatchQueue.main.async {
221
- UIApplication.shared.open(url, options: [:], completionHandler: nil)
222
- }
223
- }
127
+ let requestBody = _isSecure && !(encKey ?? "").isEmpty ? try AcmoEncrypt(encKey!).encryptDataAESGCM(data: fd) : fd
128
+ request.httpBody = try JSONSerialization.data(withJSONObject: requestBody)
224
129
  } catch {
225
- print("An error occurred: \(error)")
130
+ self.log("Failed to serialize request body: \(error)")
131
+ throw error
226
132
  }
227
- }
228
- }
229
-
133
+ let hasAccepted = UserDefaults.standard.bool(forKey: "\(AcmoKeyNames.PRIVACY_ACCEPTED_FOR_USER_ID)\(Tyrads.instance.publisherUserID)")
134
+ // Use the async URLSession API to get data
135
+ let (data, _) = try await URLSession.shared.data(for: request)
136
+
137
+ let responseString = String(data: data, encoding: .utf8)
138
+ self.log("Received response: \(responseString ?? "nil")")
230
139
 
231
- extension Tyrads: WKScriptMessageHandler {
232
- public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
233
- guard message.name == "clickHandler",
234
- let messageDict = message.body as? [String: Any] else {
235
- return
140
+ guard let acmoInitModel = try? JSONDecoder().decode(AcmoInitModel.self, from: data) else {
141
+ self.log("Failed to decode response")
142
+ throw NSError(domain: "TyradsSdk", code: 2, userInfo: [NSLocalizedDescriptionKey: "Failed to decode response"])
236
143
  }
237
- print("Message data: \(messageDict)")
144
+
145
+ self.loginData = acmoInitModel
146
+ self.publisherUserID = acmoInitModel.data.user.publisherUserId
147
+ self.newUser = acmoInitModel.data.newRegisteredUser
148
+ self.token = acmoInitModel.data.token
149
+ self.log("Login successful. Publisher User ID: \(self.publisherUserID), New User: \(self.newUser)")
150
+ self.mainColor = acmoInitModel.data.publisherApp.mainColor
238
151
 
239
- if let action = messageDict["action"] as? String {
240
- switch action {
241
- case "closeWebview":
242
- DispatchQueue.main.async {
243
- UIApplication.shared.windows.first?.rootViewController?.dismiss(animated: true)
244
- }
245
-
246
- case "changeLanguage":
247
- if let langCode = messageDict["languageCode"] as? String {
248
- // Handle language change
249
- self.currentLanguage = langCode
250
- }
251
-
252
- default:
253
- print("Unknown command: \(action)")
152
+
153
+ let headers = await ApiHeaders(
154
+ xApiKey: self.apiKey,
155
+ xApiSecret: self.apiSecret,
156
+ xUserId: self.publisherUserID,
157
+ xSdkPlatform: AcmoConfig.SDK_PLATFORM,
158
+ xSdkVersion: AcmoConfig.SDK_VERSION,
159
+ userAgent: UIDevice.current.systemName + "/" + UIDevice.current.systemVersion,
160
+ languageCode: self.currentLanguage,
161
+ premiumColor: acmoInitModel.data.publisherApp.premiumColor,
162
+ headerColor: acmoInitModel.data.publisherApp.headerColor,
163
+ mainColor: acmoInitModel.data.publisherApp.mainColor,
164
+ privacyAccepted: hasAccepted
165
+ )
166
+ return headers
167
+ }
168
+
169
+
170
+
171
+
172
+ public func showOffers(_ launchMode: Int = 3, route: String? = nil, campaignID: Int? = nil) async {
173
+ // self.initializationWait.wait()
174
+ let skipUserUpdate = getSkipUserUpdate()
175
+ await ensureInitialized()
176
+ var components = URLComponents()
177
+ components.scheme = "https"
178
+ components.host = "sdk.tyrads.com"
179
+ // components.path = "/\(route ?? "")"
180
+ components.queryItems = [
181
+ URLQueryItem(name: "token", value: self.token),
182
+ URLQueryItem(name: "to", value: campaignID != nil ? "\(route ?? "")/\(campaignID!)" : route),
183
+ URLQueryItem(name: "lang", value: self.currentLanguage),
184
+ URLQueryItem(name: "skipUserInfo", value: "\(skipUserUpdate)")
185
+ ]
186
+ var urlString: String = ""
187
+ if let url = components.url {
188
+ urlString = url.absoluteString
189
+ print(urlString)
190
+ } else {
191
+ print("Failed to create URL with components: \(components)")
192
+ }
193
+
194
+ do {
195
+ guard let url = URL(string: urlString) else {
196
+ throw NSError(domain: "TyradsSdk", code: 1, userInfo: [NSLocalizedDescriptionKey: "Invalid URL"])
197
+ }
198
+
199
+ switch launchMode {
200
+ case 1, 2:
201
+ DispatchQueue.main.async {
202
+ guard let rootVC = UIApplication.shared.windows.first?.rootViewController else { return }
203
+
204
+ let showWebView: () -> Void = {
205
+ let webVC = AcmoWebViewController(url: url)
206
+ webVC.modalPresentationStyle = .fullScreen
207
+ rootVC.present(webVC, animated: true)
208
+ }
209
+
210
+ let showUserUpdateOrWeb: () -> Void = {
211
+ if Tyrads.instance.newUser {
212
+ let userUpdateVC = AcmoUsersUpdateController(onSubmit: {
213
+ showWebView()
214
+ })
215
+ userUpdateVC.isModalInPresentation = false
216
+ rootVC.present(userUpdateVC, animated: true)
217
+ } else {
218
+ showWebView()
219
+ }
220
+ }
221
+
222
+ let hasAccepted = Tyrads.instance.isPrivacyAccepted()
223
+
224
+ if launchMode == 1 || launchMode == 2 {
225
+ if !hasAccepted {
226
+ let privacyController = AcmoPrivacyPolicyController(onAccept: {
227
+ showUserUpdateOrWeb()
228
+ })
229
+ privacyController.modalPresentationStyle = .fullScreen
230
+ rootVC.present(privacyController, animated: true)
231
+ } else {
232
+ showUserUpdateOrWeb()
254
233
  }
234
+ } else {
235
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
236
+ }
255
237
  }
238
+ case 3:
239
+ DispatchQueue.main.async {
240
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
241
+ }
242
+ default:
243
+ DispatchQueue.main.async {
244
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
245
+ }
246
+ }
247
+ } catch {
248
+ print("An error occurred: \(error)")
256
249
  }
257
- }
250
+ }
251
+
252
+ public func setNewUser(_ newValue: Bool){
253
+ self.newUser = newValue
254
+ }
255
+
256
+ public func setSkipUserUpdate(_ newValue: Bool){
257
+ let key = "\(AcmoKeyNames.SKIP_FOR_USER_ID)\(self.publisherUserID)"
258
+ UserDefaults.standard.set(newValue, forKey: key)
259
+ }
260
+ public func getSkipUserUpdate() -> Bool{
261
+ let key = "\(AcmoKeyNames.SKIP_FOR_USER_ID)\(self.publisherUserID)"
262
+ return (UserDefaults.standard.bool(forKey: key) || newUser == false)
263
+ }
258
264
 
259
- extension Tyrads: WKNavigationDelegate {
260
- public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
261
- let js = """
262
- window.addEventListener('message', (event) => {
263
- try {
264
- const message = typeof event.data === 'string'
265
- ? JSON.parse(event.data)
266
- : event.data;
267
- if (message && message.command === 'webview_command') {
268
- window.webkit.messageHandlers.clickHandler.postMessage({
269
- command: message.command,
270
- action: message.action,
271
- languageCode: message.languageCode
272
- });
273
- }
274
- } catch (error) {
275
- console.log('Message handling error:', error);
265
+ public func changeLanguage(_ lang: String) async {
266
+ self.currentLanguage = lang
267
+ UserDefaults.standard.set(lang, forKey: "locale")
268
+ await LocalizationService.shared.changeLanguage(locale: lang)
269
+ }
270
+
271
+ public func isPrivacyAccepted() -> Bool {
272
+ let key = "\(AcmoKeyNames.PRIVACY_ACCEPTED_FOR_USER_ID)\(self.publisherUserID)"
273
+ return UserDefaults.standard.bool(forKey: key)
274
+ }
275
+
276
+ public func checkOnboardingProcess() async -> Bool {
277
+ await ensureInitialized()
278
+
279
+ return await withCheckedContinuation { continuation in
280
+ Task { @MainActor in
281
+ guard let rootVC = UIApplication.shared.windows.first?.rootViewController else {
282
+ continuation.resume(returning: false)
283
+ return
284
+ }
285
+
286
+ let finishFlow: () -> Void = {
287
+ continuation.resume(returning: true)
288
+ }
289
+
290
+ let showUserUpdate: () -> Void = {
291
+ let userUpdateVC = AcmoUsersUpdateController(onSubmit: {
292
+ rootVC.dismiss(animated: true) {
293
+ print("User Update submitted, view dismissed.")
294
+ finishFlow()
276
295
  }
277
- });
278
- """
296
+ })
297
+ userUpdateVC.isModalInPresentation = false
298
+ rootVC.present(userUpdateVC, animated: true)
299
+ }
279
300
 
280
- webView.evaluateJavaScript(js) { _, error in
281
- if let error = error {
282
- print("JavaScript injection failed: \(error)")
301
+ let hasAcceptedPrivacy = self.isPrivacyAccepted()
302
+ let isNewUser = Tyrads.instance.newUser
303
+
304
+ print("showPrivacyFlowAndDismissOnComplete: Privacy Accepted: \(hasAcceptedPrivacy), New User: \(isNewUser)")
305
+
306
+ if !hasAcceptedPrivacy {
307
+ let privacyController = AcmoPrivacyPolicyController(onAccept: {
308
+ if isNewUser {
309
+ showUserUpdate()
310
+ } else {
311
+ rootVC.dismiss(animated: true) {
312
+ print("Privacy accepted, user is not new, view dismissed.")
313
+ finishFlow()
314
+ }
283
315
  }
316
+ })
317
+ privacyController.modalPresentationStyle = .fullScreen
318
+ rootVC.present(privacyController, animated: true)
319
+ } else if isNewUser {
320
+ showUserUpdate()
321
+ } else {
322
+ print("Privacy accepted and user not new. No flow presented.")
323
+ finishFlow()
284
324
  }
325
+ }
285
326
  }
327
+ }
286
328
  }