@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.
- package/LICENSE +11 -11
- package/android/build.gradle +117 -117
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/AndroidManifestNew.xml +2 -2
- package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -112
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +56 -56
- package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +18 -21
- package/ios/Tyrads/AcmoConfig.swift +32 -31
- package/ios/Tyrads/ApiHeaders.swift +12 -0
- package/ios/Tyrads/InitModel.swift +48 -46
- package/ios/Tyrads/Tyrads.swift +199 -176
- package/ios/TyradsSdk-Bridging-Header.h +2 -2
- package/ios/TyradsSdk.mm +14 -11
- package/ios/TyradsSdk.swift +47 -27
- package/lib/commonjs/acmo/core/marquee.js.map +1 -1
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
- package/lib/commonjs/acmo/core/types/types.d.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +3 -5
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +3 -8
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +3 -3
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +2 -7
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +4 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +4 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +5 -6
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +23 -7
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/i18n.js.map +1 -1
- package/lib/commonjs/index.js +12 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/marquee.js.map +1 -1
- package/lib/module/acmo/core/storage/storage.js.map +1 -1
- package/lib/module/acmo/core/types/types.d.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js +3 -5
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +3 -8
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +3 -3
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +2 -7
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +4 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +4 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +5 -6
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/top_offers.js +23 -7
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/module/i18n.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +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_option_1.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -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 +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +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_option_1.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -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 +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +197 -197
- package/readme.md +95 -97
- package/src/acmo/core/marquee.tsx +61 -61
- package/src/acmo/core/storage/storage.ts +27 -27
- package/src/acmo/core/types/types.d.ts +93 -93
- package/src/acmo/modules/dashboard/components/auto_scroller.tsx +84 -84
- package/src/acmo/modules/dashboard/components/custom_card.tsx +30 -30
- package/src/acmo/modules/dashboard/components/my_games_button.tsx +39 -39
- package/src/acmo/modules/dashboard/components/offer_info_section.tsx +138 -143
- package/src/acmo/modules/dashboard/components/premium_header.tsx +80 -80
- package/src/acmo/modules/dashboard/components/premium_option_1.tsx +155 -160
- package/src/acmo/modules/dashboard/components/premium_option_2.tsx +99 -103
- package/src/acmo/modules/dashboard/components/premium_option_3.tsx +41 -45
- package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -183
- package/src/acmo/modules/dashboard/repository.ts +94 -94
- package/src/acmo/modules/dashboard/top_offers.tsx +144 -131
- package/src/i18n.ts +114 -114
- package/src/index.tsx +89 -81
- 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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
}
|
80
|
-
|
81
|
-
|
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;
|
package/tyrads-sdk.podspec
CHANGED
@@ -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
|