@tyrads.com/tyrads-sdk 2.0.0-beta.2 → 2.0.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 (122) hide show
  1. package/LICENSE +11 -11
  2. package/android/build.gradle +117 -117
  3. package/android/gradle.properties +5 -5
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/AndroidManifestNew.xml +2 -2
  6. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -112
  7. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +56 -56
  8. package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +18 -21
  9. package/ios/Tyrads/AcmoConfig.swift +32 -31
  10. package/ios/Tyrads/ApiHeaders.swift +12 -0
  11. package/ios/Tyrads/InitModel.swift +48 -46
  12. package/ios/Tyrads/Tyrads.swift +199 -176
  13. package/ios/TyradsSdk-Bridging-Header.h +2 -2
  14. package/ios/TyradsSdk.mm +14 -11
  15. package/ios/TyradsSdk.swift +47 -27
  16. package/lib/commonjs/acmo/core/marquee.js.map +1 -1
  17. package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
  18. package/lib/commonjs/acmo/core/types/types.d.js.map +1 -1
  19. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  20. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  21. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +3 -5
  22. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  23. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  24. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  25. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +3 -3
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  32. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  33. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  34. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  35. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  36. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +23 -7
  37. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  38. package/lib/commonjs/i18n.js.map +1 -1
  39. package/lib/commonjs/index.js +12 -2
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/module/acmo/core/marquee.js.map +1 -1
  42. package/lib/module/acmo/core/storage/storage.js.map +1 -1
  43. package/lib/module/acmo/core/types/types.d.js.map +1 -1
  44. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  45. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  46. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +3 -5
  47. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  48. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  49. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  50. package/lib/module/acmo/modules/dashboard/components/premium_header.js +3 -3
  51. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  52. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  53. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  54. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  55. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  56. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  57. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  58. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  59. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  60. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  61. package/lib/module/acmo/modules/dashboard/top_offers.js +23 -7
  62. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  63. package/lib/module/i18n.js.map +1 -1
  64. package/lib/module/index.js +12 -2
  65. package/lib/module/index.js.map +1 -1
  66. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  70. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  72. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  74. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  76. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  78. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  80. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  83. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  85. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  86. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  87. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  88. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  89. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  90. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  91. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  92. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  93. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  94. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  95. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  96. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  97. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  98. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  99. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  100. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  101. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  102. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  103. package/lib/typescript/module/src/index.d.ts.map +1 -1
  104. package/package.json +197 -197
  105. package/readme.md +95 -97
  106. package/src/acmo/core/marquee.tsx +61 -61
  107. package/src/acmo/core/storage/storage.ts +27 -27
  108. package/src/acmo/core/types/types.d.ts +93 -93
  109. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +84 -84
  110. package/src/acmo/modules/dashboard/components/custom_card.tsx +30 -30
  111. package/src/acmo/modules/dashboard/components/my_games_button.tsx +39 -39
  112. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +138 -143
  113. package/src/acmo/modules/dashboard/components/premium_header.tsx +80 -80
  114. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +155 -160
  115. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +99 -103
  116. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +41 -45
  117. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -183
  118. package/src/acmo/modules/dashboard/repository.ts +94 -94
  119. package/src/acmo/modules/dashboard/top_offers.tsx +144 -131
  120. package/src/i18n.ts +114 -114
  121. package/src/index.tsx +89 -81
  122. package/tyrads-sdk.podspec +41 -41
package/src/index.tsx CHANGED
@@ -1,81 +1,89 @@
1
- import { NativeModules, Platform, View,} from 'react-native';
2
-
3
- import TopOffers from './acmo/modules/dashboard/top_offers';
4
- import { saveData } from './acmo/core/storage/storage';
5
- import { I18nextProvider } from 'react-i18next';
6
- import i18n from './i18n';
7
-
8
- // const TyradsSdkComposeView = requireNativeComponent('TyradsSdkComposeView');
9
-
10
-
11
- const LINKING_ERROR =
12
- `The package 'tyrads-sdk' doesn't seem to be linked. Make sure: \n\n` +
13
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
14
- '- You rebuilt the app after installing the package\n' +
15
- '- You are not using Expo Go\n';
16
-
17
- const TyradsSdk = NativeModules.TyradsSdk
18
- ? NativeModules.TyradsSdk
19
- : new Proxy(
20
- {},
21
- {
22
- get() {
23
- throw new Error(LINKING_ERROR);
24
- },
25
- }
26
- );
27
-
28
- const Tyrads = {
29
- init: (apiKey: string, apiSecret: string) => {
30
- return TyradsSdk.init(apiKey, apiSecret);
31
- },
32
- loginUser: async (userId: string) =>{
33
- try{
34
- var data = await TyradsSdk.loginUser(userId);
35
- console.log("data from login: ",data);
36
-
37
- await saveData('apiHeaders', data);
38
- await saveData('language', JSON.parse(data).languageCode);
39
- }catch (err){
40
- console.log(err);
41
- }
42
- return TyradsSdk.loginUser(userId);
43
- },
44
- showOffers: ({
45
- launchMode = 3,
46
- route,
47
- campaignID = 0,
48
- }: { launchMode?: number; route?: string; campaignID?: number } = {}) => {
49
- if (Platform.OS === 'ios') {
50
- return TyradsSdk.showOffers(launchMode, route, campaignID);
51
- } else {
52
- return TyradsSdk.showOffers(route, campaignID);
53
- }
54
- },
55
- topPremiumOffers: ({
56
- showMore = true,
57
- showMyOffers = true,
58
- showMyOffersEmptyView = false,
59
- viewStyle = 1,
60
- }: {
61
- showMore?: boolean;
62
- showMyOffers?: boolean;
63
- showMyOffersEmptyView?: boolean;
64
- viewStyle?: number;
65
- } = {}) => {
66
- return (
67
- <I18nextProvider i18n={i18n}>
68
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
69
- <TopOffers
70
- showMore={showMore}
71
- showMyOffers={showMyOffers}
72
- showMyOffersEmptyView={showMyOffersEmptyView}
73
- style={viewStyle}
74
- />
75
- </View>
76
- </I18nextProvider>
77
- );
78
- },
79
- };
80
-
81
- export default Tyrads;
1
+ import { NativeModules, Platform, View,} from 'react-native';
2
+
3
+ import TopOffers from './acmo/modules/dashboard/top_offers';
4
+ import { saveData } from './acmo/core/storage/storage';
5
+ import { I18nextProvider } from 'react-i18next';
6
+ import i18n from './i18n';
7
+
8
+ // const TyradsSdkComposeView = requireNativeComponent('TyradsSdkComposeView');
9
+
10
+
11
+ const LINKING_ERROR =
12
+ `The package 'tyrads-sdk' doesn't seem to be linked. Make sure: \n\n` +
13
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
14
+ '- You rebuilt the app after installing the package\n' +
15
+ '- You are not using Expo Go\n';
16
+
17
+ const TyradsSdk = NativeModules.TyradsSdk
18
+ ? NativeModules.TyradsSdk
19
+ : new Proxy(
20
+ {},
21
+ {
22
+ get() {
23
+ throw new Error(LINKING_ERROR);
24
+ },
25
+ }
26
+ );
27
+
28
+ const Tyrads = {
29
+ init: (apiKey: string, apiSecret: string) => {
30
+ return TyradsSdk.init(apiKey, apiSecret);
31
+ },
32
+ loginUser: async (userId: string) =>{
33
+ try{
34
+ var data = await TyradsSdk.loginUser(userId);
35
+ console.log("data from login: ",data);
36
+
37
+ if(typeof data === "object"){
38
+ data = JSON.stringify(data);
39
+ }
40
+
41
+ await saveData('apiHeaders', data);
42
+ await saveData('language', JSON.parse(data).languageCode);
43
+ }catch (err){
44
+ console.log(`error from login: ${err}`);
45
+ }
46
+ return TyradsSdk.loginUser(userId);
47
+ },
48
+ showOffers: ({
49
+ launchMode = 3,
50
+ route,
51
+ campaignID = 0,
52
+ }: { launchMode?: number; route?: string; campaignID?: number } = {}) => {
53
+ if (Platform.OS === 'ios') {
54
+ return TyradsSdk.showOffers(launchMode, route, campaignID);
55
+ } else {
56
+ return TyradsSdk.showOffers(route, campaignID);
57
+ }
58
+ },
59
+ topPremiumOffers: ({
60
+ showMore = true,
61
+ showMyOffers = true,
62
+ showMyOffersEmptyView = false,
63
+ viewStyle = 1,
64
+ }: {
65
+ showMore?: boolean;
66
+ showMyOffers?: boolean;
67
+ showMyOffersEmptyView?: boolean;
68
+ viewStyle?: number;
69
+ } = {}) => {
70
+ const handleNavigation = (route?: string, campaignID?: number) => {
71
+ Tyrads.showOffers({ route, campaignID });
72
+ };
73
+ return (
74
+ <I18nextProvider i18n={i18n}>
75
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
76
+ <TopOffers
77
+ showMore={showMore}
78
+ showMyOffers={showMyOffers}
79
+ showMyOffersEmptyView={showMyOffersEmptyView}
80
+ style={viewStyle}
81
+ onNavigate={handleNavigation}
82
+ />
83
+ </View>
84
+ </I18nextProvider>
85
+ );
86
+ },
87
+ };
88
+
89
+ export default Tyrads;
@@ -1,41 +1,41 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
-
6
- Pod::Spec.new do |s|
7
- s.name = "tyrads-sdk"
8
- s.version = package["version"]
9
- s.summary = package["description"]
10
- s.homepage = package["homepage"]
11
- s.license = package["license"]
12
- s.authors = package["author"]
13
-
14
- s.platforms = { :ios => min_ios_version_supported }
15
- s.source = { :git => "https://github.com/tyrads-com/tyrads-sdk-reactnative.git", :tag => "#{s.version}" }
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21
- if respond_to?(:install_modules_dependencies, true)
22
- install_modules_dependencies(s)
23
- else
24
- s.dependency "React-Core"
25
-
26
- # Don't install the dependencies when we run `pod install` in the old architecture.
27
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29
- s.pod_target_xcconfig = {
30
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33
- }
34
- s.dependency "React-Codegen"
35
- s.dependency "RCT-Folly"
36
- s.dependency "RCTRequired"
37
- s.dependency "RCTTypeSafety"
38
- s.dependency "ReactCommon/turbomodule/core"
39
- end
40
- end
41
- end
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "tyrads-sdk"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => min_ios_version_supported }
15
+ s.source = { :git => "https://github.com/tyrads-com/tyrads-sdk-reactnative.git", :tag => "#{s.version}" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+
19
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21
+ if respond_to?(:install_modules_dependencies, true)
22
+ install_modules_dependencies(s)
23
+ else
24
+ s.dependency "React-Core"
25
+
26
+ # Don't install the dependencies when we run `pod install` in the old architecture.
27
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29
+ s.pod_target_xcconfig = {
30
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33
+ }
34
+ s.dependency "React-Codegen"
35
+ s.dependency "RCT-Folly"
36
+ s.dependency "RCTRequired"
37
+ s.dependency "RCTTypeSafety"
38
+ s.dependency "ReactCommon/turbomodule/core"
39
+ end
40
+ end
41
+ end