@tyrads.com/tyrads-sdk 3.2.0-beta.0 → 3.3.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 +38 -2
- package/ios/Tyrads/AcmoConfig.swift +1 -1
- package/ios/Tyrads/Tyrads.swift +46 -2
- package/ios/Tyrads/core/models/TyradsMediaSourceInfo.swift +25 -0
- package/ios/Tyrads/core/models/TyradsUserInfo.swift +14 -0
- package/ios/Tyrads/helpers/aes_encryptor.swift +1 -1
- package/ios/TyradsSdk.mm +4 -0
- package/ios/TyradsSdk.swift +32 -2
- package/lib/commonjs/acmo/core/helpers/native_methods.js +11 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js.map +1 -1
- package/lib/commonjs/acmo/core/types/external_types.js +2 -0
- package/lib/commonjs/acmo/core/types/external_types.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +2 -3
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/acmo/modules/localization/localization_context.js +1 -2
- package/lib/commonjs/acmo/modules/localization/localization_context.js.map +1 -1
- package/lib/commonjs/acmo_config.js +17 -0
- package/lib/commonjs/acmo_config.js.map +1 -0
- package/lib/commonjs/index.js +12 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/helpers/native_methods.js +11 -0
- package/lib/module/acmo/core/helpers/native_methods.js.map +1 -1
- package/lib/module/acmo/core/types/external_types.js +2 -0
- package/lib/module/acmo/core/types/external_types.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +2 -3
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -1
- package/lib/module/acmo_config.js +12 -0
- package/lib/module/acmo_config.js.map +1 -0
- package/lib/module/index.js +12 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +4 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/types/external_types.d.ts +22 -0
- package/lib/typescript/commonjs/src/acmo/core/types/external_types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo_config.d.ts +10 -0
- package/lib/typescript/commonjs/src/acmo_config.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +3 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +4 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/helpers/numeral.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/core/types/external_types.d.ts +22 -0
- package/lib/typescript/module/src/acmo/core/types/external_types.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo_config.d.ts +10 -0
- package/lib/typescript/module/src/acmo_config.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +3 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/acmo/core/helpers/native_methods.ts +16 -0
- package/src/acmo/core/types/external_types.ts +22 -0
- package/src/acmo/modules/dashboard/components/offer_list_item.tsx +1 -2
- package/src/acmo_config.ts +9 -0
- package/src/index.tsx +12 -2
- package/tyrads-sdk.podspec +9 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tyrads.com/tyrads-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Tyrads SDK for React Native ",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -66,11 +66,12 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@commitlint/config-conventional": "^17.0.2",
|
|
68
68
|
"@evilmartians/lefthook": "^1.5.0",
|
|
69
|
-
"@react-native/
|
|
69
|
+
"@react-native-community/cli": "latest",
|
|
70
|
+
"@react-native/eslint-config": "^0.79.1",
|
|
70
71
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
71
72
|
"@types/jest": "^29.5.5",
|
|
72
73
|
"@types/numeral": "^2.0.5",
|
|
73
|
-
"@types/react": "^
|
|
74
|
+
"@types/react": "^19.0.0",
|
|
74
75
|
"@types/react-native-snap-carousel": "^3.8.11",
|
|
75
76
|
"commitlint": "^17.0.2",
|
|
76
77
|
"del-cli": "^5.1.0",
|
|
@@ -79,8 +80,8 @@
|
|
|
79
80
|
"eslint-plugin-prettier": "^5.0.1",
|
|
80
81
|
"jest": "^29.7.0",
|
|
81
82
|
"prettier": "^3.0.3",
|
|
82
|
-
"react": "
|
|
83
|
-
"react-native": "0.
|
|
83
|
+
"react": "19.0.0",
|
|
84
|
+
"react-native": "0.79.2",
|
|
84
85
|
"react-native-builder-bob": "^0.29.0",
|
|
85
86
|
"release-it": "^15.0.0",
|
|
86
87
|
"turbo": "^1.10.7",
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NativeModules, Platform } from "react-native";
|
|
2
|
+
import { AcmoConfig } from "../../../acmo_config";
|
|
3
|
+
import type { TyradsMediaSourceInfo, TyradsUserInfo } from "../types/external_types";
|
|
2
4
|
|
|
3
5
|
const LINKING_ERROR =
|
|
4
6
|
`The package 'tyrads-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
@@ -20,6 +22,20 @@ const TyradsSdk = NativeModules.TyradsSdk
|
|
|
20
22
|
|
|
21
23
|
const TyradsNativeMethods = {
|
|
22
24
|
|
|
25
|
+
setSDKVersion: () => {
|
|
26
|
+
const version = AcmoConfig.SDK_VERSION;
|
|
27
|
+
TyradsSdk.setSDKVersion(version);
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
setMediaSourceInfo: (mediaSourceInfo: TyradsMediaSourceInfo) => {
|
|
31
|
+
TyradsSdk.setMediaSourceInfo(mediaSourceInfo);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
setUserInfo: (userInfo: TyradsUserInfo) => {
|
|
35
|
+
TyradsSdk.setUserInfo(userInfo);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
|
|
23
39
|
isPrivacyAccepted: async () => {
|
|
24
40
|
try {
|
|
25
41
|
return await TyradsSdk.isPrivacyAccepted();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TyradsMediaSourceInfo {
|
|
2
|
+
mediaSourceName?: string,
|
|
3
|
+
mediaCampaignName?: string,
|
|
4
|
+
mediaSourceId?: string,
|
|
5
|
+
mediaSubSourceId?: string,
|
|
6
|
+
incentivized?: boolean,
|
|
7
|
+
mediaAdsetName?: string,
|
|
8
|
+
mediaAdsetId?: string,
|
|
9
|
+
mediaCreativeName?: string,
|
|
10
|
+
mediaCreativeId?: string,
|
|
11
|
+
sub1?: string,
|
|
12
|
+
sub2?: string,
|
|
13
|
+
sub3?: string,
|
|
14
|
+
sub4?: string,
|
|
15
|
+
sub5?: string,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TyradsUserInfo {
|
|
19
|
+
email?: string,
|
|
20
|
+
phoneNumber?: string,
|
|
21
|
+
userGroup?: string
|
|
22
|
+
}
|
|
@@ -192,7 +192,7 @@ const styles = StyleSheet.create({
|
|
|
192
192
|
payoutRow: {
|
|
193
193
|
flexDirection: 'row',
|
|
194
194
|
alignItems: 'center',
|
|
195
|
-
gap:
|
|
195
|
+
gap: 4,
|
|
196
196
|
},
|
|
197
197
|
strikeText: {
|
|
198
198
|
fontSize: 12,
|
|
@@ -203,7 +203,6 @@ const styles = StyleSheet.create({
|
|
|
203
203
|
currencyIcon: {
|
|
204
204
|
width: 14,
|
|
205
205
|
height: 14,
|
|
206
|
-
marginHorizontal: 4,
|
|
207
206
|
},
|
|
208
207
|
payoutText: {
|
|
209
208
|
fontSize: 12,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class AcmoConfig {
|
|
2
|
+
public static API_VERSION = "3.0";
|
|
3
|
+
public static MAJOR_VERSION = "3";
|
|
4
|
+
public static MINOR_VERSION = "3";
|
|
5
|
+
public static PATCH_VERSION = "0";
|
|
6
|
+
public static BUILD_VERSION = "0";
|
|
7
|
+
public static SDK_PLATFORM = "React Native";
|
|
8
|
+
public static SDK_VERSION = `${this.MAJOR_VERSION}.${this.MINOR_VERSION}.${this.PATCH_VERSION}-${this.BUILD_VERSION}`;
|
|
9
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -5,6 +5,9 @@ import { saveData } from './acmo/core/storage/storage';
|
|
|
5
5
|
import Localization from './acmo/core/services/localization_service';
|
|
6
6
|
import { changeProviderLanguage, LocalizationProvider, updateProviderLanguage } from './acmo/modules/localization/localization_context';
|
|
7
7
|
import PremiumWidgetsLoading from './acmo/modules/dashboard/components/premium_loading';
|
|
8
|
+
import TyradsNativeMethods from './acmo/core/helpers/native_methods';
|
|
9
|
+
import type { TyradsMediaSourceInfo, TyradsUserInfo } from './acmo/core/types/external_types';
|
|
10
|
+
export type { TyradsMediaSourceInfo } from './acmo/core/types/external_types'
|
|
8
11
|
|
|
9
12
|
// const TyradsSdkComposeView = requireNativeComponent('TyradsSdkComposeView');
|
|
10
13
|
|
|
@@ -31,8 +34,15 @@ const tyradsEmitter = new NativeEventEmitter(TyradsSdk);
|
|
|
31
34
|
let languageChangedSubscription: any = null;
|
|
32
35
|
|
|
33
36
|
const Tyrads = {
|
|
34
|
-
init: async (apiKey: string, apiSecret: string, encKey?: string) => {
|
|
35
|
-
|
|
37
|
+
init: async (apiKey: string, apiSecret: string, encKey?: string, engagementId?: string, mediaSourceInfo?: TyradsMediaSourceInfo, userInfo?: TyradsUserInfo,) => {
|
|
38
|
+
TyradsNativeMethods.setSDKVersion();
|
|
39
|
+
if (mediaSourceInfo) {
|
|
40
|
+
TyradsNativeMethods.setMediaSourceInfo(mediaSourceInfo);
|
|
41
|
+
}
|
|
42
|
+
if (userInfo) {
|
|
43
|
+
TyradsNativeMethods.setUserInfo(userInfo);
|
|
44
|
+
}
|
|
45
|
+
const data = await TyradsSdk.init(apiKey, apiSecret, encKey, engagementId);
|
|
36
46
|
|
|
37
47
|
await saveData("credentials", {
|
|
38
48
|
'X-API-Key': apiKey,
|
package/tyrads-sdk.podspec
CHANGED
|
@@ -15,6 +15,11 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { :git => "https://github.com/tyrads-com/tyrads-sdk-reactnative.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
+
|
|
19
|
+
s.pod_target_xcconfig = {
|
|
20
|
+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
|
|
21
|
+
'OTHER_SWIFT_FLAGS' => '-DDEBUG'
|
|
22
|
+
}
|
|
18
23
|
|
|
19
24
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
20
25
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
@@ -26,11 +31,10 @@ Pod::Spec.new do |s|
|
|
|
26
31
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
27
32
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
28
33
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
29
|
-
s.pod_target_xcconfig
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
+
s.pod_target_xcconfig.merge!({
|
|
35
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
36
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
37
|
+
})
|
|
34
38
|
s.dependency "React-Codegen"
|
|
35
39
|
s.dependency "RCT-Folly"
|
|
36
40
|
s.dependency "RCTRequired"
|