@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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +130 -29
- package/ios/Tyrads/AcmoAssets.swift +14 -0
- package/ios/Tyrads/ApiHeaders.swift +1 -0
- package/ios/Tyrads/InitModel.swift +3 -0
- package/ios/Tyrads/Tyrads.swift +255 -213
- package/ios/Tyrads/WebViewController.swift +195 -0
- package/ios/Tyrads/core/utils/AcmoKeyNames.swift +29 -0
- package/ios/Tyrads/core/utils/ColorExtension.swift +55 -0
- package/ios/Tyrads/core/utils/Services/LocalizationService.swift +175 -0
- package/ios/Tyrads/helpers/device_details.swift +160 -0
- package/ios/Tyrads/legal/AcmoPrivacyPage.swift +353 -0
- package/ios/Tyrads/legal/PrivacyPageController.swift +31 -0
- package/ios/Tyrads/user/AcmoUserUpdatePage.swift +302 -0
- package/ios/Tyrads/user/AcmoUsersUpdateController.swift +26 -0
- package/ios/Tyrads/user/Repository.swift +89 -0
- package/ios/TyradsSdk.mm +22 -4
- package/ios/TyradsSdk.swift +101 -31
- package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
- package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js +37 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js +19 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/commonjs/acmo/core/services/localization_service.js +164 -0
- package/lib/commonjs/acmo/core/services/localization_service.js.map +1 -0
- package/lib/commonjs/acmo/core/storage/storage.js +15 -1
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +79 -0
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
- package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +263 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +203 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +87 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +16 -14
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +111 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
- package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +85 -63
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/acmo/modules/localization/localization_context.js +56 -0
- package/lib/commonjs/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/commonjs/assets/images/angle_up.png +0 -0
- package/lib/commonjs/assets/images/diamond.png +0 -0
- package/lib/commonjs/assets/images/info.png +0 -0
- package/lib/commonjs/assets/images/info_icon.png +0 -0
- package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
- package/lib/commonjs/assets/images/rank_1.png +0 -0
- package/lib/commonjs/assets/images/rank_2.png +0 -0
- package/lib/commonjs/assets/images/rank_3.png +0 -0
- package/lib/commonjs/assets/images/rank_4.png +0 -0
- package/lib/commonjs/assets/images/rank_5.png +0 -0
- package/lib/commonjs/index.js +50 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/helpers/launcher.js +15 -0
- package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
- package/lib/module/acmo/core/helpers/native_methods.js +33 -0
- package/lib/module/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/module/acmo/core/helpers/numeral.js +14 -0
- package/lib/module/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/module/acmo/core/services/localization_service.js +159 -0
- package/lib/module/acmo/core/services/localization_service.js.map +1 -0
- package/lib/module/acmo/core/storage/storage.js +13 -0
- package/lib/module/acmo/core/storage/storage.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +73 -0
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
- package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
- package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
- package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
- package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +197 -0
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +82 -0
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +16 -14
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js +106 -0
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/repository.js +105 -30
- package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/top_offers.js +86 -64
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/module/acmo/modules/localization/localization_context.js +45 -0
- package/lib/module/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/module/assets/images/angle_up.png +0 -0
- package/lib/module/assets/images/diamond.png +0 -0
- package/lib/module/assets/images/info.png +0 -0
- package/lib/module/assets/images/info_icon.png +0 -0
- package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
- package/lib/module/assets/images/rank_1.png +0 -0
- package/lib/module/assets/images/rank_2.png +0 -0
- package/lib/module/assets/images/rank_3.png +0 -0
- package/lib/module/assets/images/rank_4.png +0 -0
- package/lib/module/assets/images/rank_5.png +0 -0
- package/lib/module/index.js +49 -17
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +8 -6
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
- package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +8 -6
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +3 -6
- package/readme.md +8 -8
- package/src/acmo/core/helpers/launcher.ts +14 -0
- package/src/acmo/core/helpers/native_methods.ts +43 -0
- package/src/acmo/core/helpers/numeral.ts +14 -0
- package/src/acmo/core/services/localization_service.ts +200 -0
- package/src/acmo/core/storage/storage.ts +14 -0
- package/src/acmo/core/types/types.d.ts +11 -13
- package/src/acmo/modules/dashboard/components/active_offers_button.tsx +62 -0
- package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
- package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
- package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
- package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
- package/src/acmo/modules/dashboard/components/offer_list_item.tsx +228 -0
- package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +79 -0
- package/src/acmo/modules/dashboard/components/premium_header.tsx +14 -13
- package/src/acmo/modules/dashboard/components/premium_loading.tsx +72 -0
- package/src/acmo/modules/dashboard/repository.ts +121 -46
- package/src/acmo/modules/dashboard/top_offers.tsx +105 -53
- package/src/acmo/modules/localization/localization_context.tsx +52 -0
- package/src/assets/images/angle_up.png +0 -0
- package/src/assets/images/diamond.png +0 -0
- package/src/assets/images/info.png +0 -0
- package/src/assets/images/info_icon.png +0 -0
- package/src/assets/images/premium-emptybg.jpeg +0 -0
- package/src/assets/images/rank_1.png +0 -0
- package/src/assets/images/rank_2.png +0 -0
- package/src/assets/images/rank_3.png +0 -0
- package/src/assets/images/rank_4.png +0 -0
- package/src/assets/images/rank_5.png +0 -0
- package/src/index.tsx +76 -34
- package/lib/commonjs/acmo/core/marquee.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -180
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
- package/lib/commonjs/i18n.js +0 -112
- package/lib/commonjs/i18n.js.map +0 -1
- package/lib/module/acmo/core/marquee.js +0 -54
- package/lib/module/acmo/core/marquee.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -174
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
- package/lib/module/i18n.js +0 -107
- package/lib/module/i18n.js.map +0 -1
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/i18n.d.ts +0 -3
- package/lib/typescript/commonjs/src/i18n.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
- package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
- package/lib/typescript/module/src/i18n.d.ts +0 -3
- package/lib/typescript/module/src/i18n.d.ts.map +0 -1
- package/src/acmo/core/marquee.tsx +0 -62
- package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
- package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
- package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
- package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -163
- package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
- package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
- package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
- package/src/i18n.ts +0 -115
package/ios/Tyrads/Tyrads.swift
CHANGED
@@ -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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
private var
|
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
|
-
|
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
|
-
|
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
|
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
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
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
|
-
|
176
|
-
|
177
|
-
|
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
|
-
|
186
|
-
|
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
|
-
|
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
|
-
|
232
|
-
|
233
|
-
|
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
|
-
|
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
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
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
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
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
|
-
|
281
|
-
|
282
|
-
|
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
|
}
|