@igaworks/adbrix-react-native-sdk 1.0.1
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/CHANGELOG.md +31 -0
- package/LICENSE +20 -0
- package/README.md +16 -0
- package/adbrix-react-native-sdk.podspec +20 -0
- package/android/build.gradle +78 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeParser.java +220 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkModule.java +166 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkPackage.java +29 -0
- package/babel.config.js +3 -0
- package/example/.bundle/config +2 -0
- package/example/.watchmanconfig +1 -0
- package/example/Gemfile +10 -0
- package/example/README.md +106 -0
- package/example/android/README.md +24 -0
- package/example/android/app/build.gradle +128 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +9 -0
- package/example/android/app/src/main/AndroidManifest.xml +34 -0
- package/example/android/app/src/main/ic_launcher-playstore.png +0 -0
- package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainActivity.kt +28 -0
- package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainApplication.kt +44 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +21 -0
- package/example/android/gradle.properties +39 -0
- package/example/android/settings.gradle +6 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +4 -0
- package/example/index.js +5 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/AdbrixReactNativeSdkExample/AppDelegate.swift +53 -0
- package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/AdbrixReactNativeSdkExample/Info.plist +62 -0
- package/example/ios/AdbrixReactNativeSdkExample/LaunchScreen.storyboard +47 -0
- package/example/ios/AdbrixReactNativeSdkExample/PrivacyInfo.xcprivacy +37 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/project.pbxproj +488 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/xcshareddata/xcschemes/AdbrixReactNativeSdkExample.xcscheme +88 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/Podfile +35 -0
- package/example/ios/Podfile.lock +1821 -0
- package/example/jest.config.js +3 -0
- package/example/metro.config.js +27 -0
- package/example/package.json +33 -0
- package/example/react-native.config.js +21 -0
- package/example/src/App.tsx +755 -0
- package/ios/AdbrixPropertiesParser.h +16 -0
- package/ios/AdbrixPropertiesParser.m +97 -0
- package/ios/AdbrixReactNative.swift +170 -0
- package/ios/AdbrixReactNativeSdk.h +11 -0
- package/ios/AdbrixReactNativeSdk.m +79 -0
- package/ios/AdbrixReactNativeSdk.xcodeproj/project.pbxproj +324 -0
- package/lib/commonjs/constants.js +174 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.d.js +6 -0
- package/lib/commonjs/index.d.js.map +1 -0
- package/lib/commonjs/index.js +155 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/properties.js +347 -0
- package/lib/commonjs/properties.js.map +1 -0
- package/lib/index.d.ts +312 -0
- package/lib/module/constants.js +170 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.d.js +4 -0
- package/lib/module/index.d.js.map +1 -0
- package/lib/module/index.js +121 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/properties.js +342 -0
- package/lib/module/properties.js.map +1 -0
- package/package.json +57 -0
- package/src/constants.js +175 -0
- package/src/index.d.ts +312 -0
- package/src/index.js +124 -0
- package/src/properties.js +275 -0
- package/tsconfig.json +29 -0
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@igaworks/adbrix-react-native-sdk",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "This is Official Adbrix 2.0 SDK for React Native.",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"react-native": "src/index.js",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"react-native",
|
|
11
|
+
"ios",
|
|
12
|
+
"android",
|
|
13
|
+
"igaworks",
|
|
14
|
+
"adbrix"
|
|
15
|
+
],
|
|
16
|
+
"source": "src/index",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/IGAWorksDev/adbrix-react-native-sdk.git"
|
|
20
|
+
},
|
|
21
|
+
"author": "igaworks-dev <cs@igaworks.com> (https://www.igaworks.com/)",
|
|
22
|
+
"license": "COMMERCIAL",
|
|
23
|
+
"homepage": "https://adbrix.gitbook.io/developer-guide",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@react-native/eslint-config": "^0.78.0",
|
|
26
|
+
"@types/react": "^19.0.0",
|
|
27
|
+
"react": "19.0.0",
|
|
28
|
+
"react-native": "0.78.2",
|
|
29
|
+
"react-native-builder-bob": "^0.40.12",
|
|
30
|
+
"rimraf": "^6.0.1",
|
|
31
|
+
"typescript": "^5.2.2"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "*",
|
|
35
|
+
"react-native": "*"
|
|
36
|
+
},
|
|
37
|
+
"workspaces": [
|
|
38
|
+
"example"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"clean": "rimraf lib && rimraf node_modules && (watchman watch-del-all || true)",
|
|
42
|
+
"reset": "npm run clean && npm install",
|
|
43
|
+
"build": "bob build && cp src/index.d.ts lib/index.d.ts",
|
|
44
|
+
"watch": "bob watch",
|
|
45
|
+
"prepublishOnly": "npm run build",
|
|
46
|
+
"deploy:dry-run": "npm publish --access public --dry-run",
|
|
47
|
+
"deploy": "npm publish --access public"
|
|
48
|
+
},
|
|
49
|
+
"react-native-builder-bob": {
|
|
50
|
+
"source": "src",
|
|
51
|
+
"output": "lib",
|
|
52
|
+
"targets": [
|
|
53
|
+
"commonjs",
|
|
54
|
+
"module"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/constants.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
|
|
2
|
+
export const ABEvent = {
|
|
3
|
+
LOGIN: 'abx:login',
|
|
4
|
+
LOGOUT: 'abx:logout',
|
|
5
|
+
SIGN_UP: 'abx:sign_up',
|
|
6
|
+
USE_CREDIT: 'abx:use_credit',
|
|
7
|
+
APP_UPDATE: 'abx:app_update',
|
|
8
|
+
INVITE: 'abx:invite',
|
|
9
|
+
PURCHASE: 'abx:purchase',
|
|
10
|
+
LEVEL_ACHIEVED: 'abx:level_achieved',
|
|
11
|
+
TUTORIAL_COMPLETED: 'abx:tutorial_completed',
|
|
12
|
+
CHARACTER_CREATED: 'abx:character_created',
|
|
13
|
+
STAGE_CLEARED: 'abx:stage_cleared',
|
|
14
|
+
REFUND: 'abx:refund',
|
|
15
|
+
ADD_TO_CART: 'abx:add_to_cart',
|
|
16
|
+
ADD_TO_WISHLIST: 'abx:add_to_wishlist',
|
|
17
|
+
PRODUCT_VIEW: 'abx:product_view',
|
|
18
|
+
CATEGORY_VIEW: 'abx:category_view',
|
|
19
|
+
REVIEW_ORDER: 'abx:review_order',
|
|
20
|
+
SEARCH: 'abx:search',
|
|
21
|
+
SHARE: 'abx:share',
|
|
22
|
+
VIEW_HOME: 'abx:view_home',
|
|
23
|
+
LIST_VIEW: 'abx:list_view',
|
|
24
|
+
CART_VIEW: 'abx:cart_view',
|
|
25
|
+
PAYMENT_INFO_ADDED: 'abx:paymentinfo_added',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ABEventProperty = {
|
|
29
|
+
IS_SKIP: 'abx:is_skip',
|
|
30
|
+
LEVEL: 'abx:level',
|
|
31
|
+
STAGE: 'abx:stage',
|
|
32
|
+
PREV_VER: 'abx:prev_ver',
|
|
33
|
+
CURR_VER: 'abx:curr_ver',
|
|
34
|
+
KEYWORD: 'abx:keyword',
|
|
35
|
+
SHARING_CHANNEL: 'abx:sharing_channel',
|
|
36
|
+
SIGN_CHANNEL: 'abx:sign_channel',
|
|
37
|
+
INVITE_CHANNEL: 'abx:invite_channel',
|
|
38
|
+
ORDER_ID: 'abx:order_id',
|
|
39
|
+
DELIVERY_CHARGE: 'abx:delivery_charge',
|
|
40
|
+
PENALTY_CHARGE: 'abx:penalty_charge',
|
|
41
|
+
PAYMENT_METHOD: 'abx:payment_method',
|
|
42
|
+
ORDER_SALES: 'abx:order_sales',
|
|
43
|
+
DISCOUNT: 'abx:discount',
|
|
44
|
+
CATEGORY1: 'abx:category1',
|
|
45
|
+
CATEGORY2: 'abx:category2',
|
|
46
|
+
CATEGORY3: 'abx:category3',
|
|
47
|
+
CATEGORY4: 'abx:category4',
|
|
48
|
+
CATEGORY5: 'abx:category5',
|
|
49
|
+
ITEMS: 'abx:items',
|
|
50
|
+
|
|
51
|
+
// Item specific properties
|
|
52
|
+
ITEM_PRODUCT_ID: 'abx:product_id',
|
|
53
|
+
ITEM_PRODUCT_NAME: 'abx:product_name',
|
|
54
|
+
ITEM_PRICE: 'abx:price',
|
|
55
|
+
ITEM_QUANTITY: 'abx:quantity',
|
|
56
|
+
ITEM_DISCOUNT: 'abx:discount',
|
|
57
|
+
ITEM_CURRENCY: 'abx:currency',
|
|
58
|
+
ITEM_CATEGORY1: 'abx:category1',
|
|
59
|
+
ITEM_CATEGORY2: 'abx:category2',
|
|
60
|
+
ITEM_CATEGORY3: 'abx:category3',
|
|
61
|
+
ITEM_CATEGORY4: 'abx:category4',
|
|
62
|
+
ITEM_CATEGORY5: 'abx:category5',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const ABCurrency = {
|
|
66
|
+
KRW: 'KRW',
|
|
67
|
+
USD: 'USD',
|
|
68
|
+
JPY: 'JPY',
|
|
69
|
+
EUR: 'EUR',
|
|
70
|
+
GBP: 'GBP',
|
|
71
|
+
CNY: 'CNY',
|
|
72
|
+
TWD: 'TWD',
|
|
73
|
+
HKD: 'HKD',
|
|
74
|
+
IDR: 'IDR', // Indonesia
|
|
75
|
+
INR: 'INR', // India
|
|
76
|
+
RUB: 'RUB', // Russia
|
|
77
|
+
THB: 'THB', // Thailand
|
|
78
|
+
VND: 'VND', // Vietnam
|
|
79
|
+
MYR: 'MYR', // Malaysia
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const ABInviteChannel = {
|
|
83
|
+
KAKAO: 'Kakao',
|
|
84
|
+
NAVER: 'Naver',
|
|
85
|
+
LINE: 'Line',
|
|
86
|
+
GOOGLE: 'Google',
|
|
87
|
+
FACEBOOK: 'Facebook',
|
|
88
|
+
TWITTER: 'Twitter',
|
|
89
|
+
WHATS_APP: 'whatsApp',
|
|
90
|
+
QQ: 'QQ',
|
|
91
|
+
WE_CHAT: 'WeChat',
|
|
92
|
+
ETC: 'ETC',
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const ABPaymentMethod = {
|
|
96
|
+
CREDIT_CARD: 'CreditCard',
|
|
97
|
+
BANK_TRANSFER: 'BankTransfer',
|
|
98
|
+
MOBILE_PAYMENT: 'MobilePayment',
|
|
99
|
+
ETC: 'ETC',
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const ABSharingChannel = {
|
|
103
|
+
FACEBOOK: 'Facebook',
|
|
104
|
+
KAKAO_TALK: 'KakaoTalk',
|
|
105
|
+
KAKAO_STORY: 'KakaoStory',
|
|
106
|
+
LINE: 'Line',
|
|
107
|
+
WHATS_APP: 'whatsApp',
|
|
108
|
+
QQ: 'QQ',
|
|
109
|
+
WE_CHAT: 'WeChat',
|
|
110
|
+
SMS: 'SMS',
|
|
111
|
+
EMAIL: 'Email',
|
|
112
|
+
COPY_URL: 'copyUrl',
|
|
113
|
+
ETC: 'ETC',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const ABSignUpChannel = {
|
|
117
|
+
KAKAO: 'Kakao',
|
|
118
|
+
NAVER: 'Naver',
|
|
119
|
+
LINE: 'Line',
|
|
120
|
+
GOOGLE: 'Google',
|
|
121
|
+
FACEBOOK: 'Facebook',
|
|
122
|
+
TWITTER: 'Twitter',
|
|
123
|
+
WHATS_APP: 'whatsApp',
|
|
124
|
+
QQ: 'QQ',
|
|
125
|
+
WE_CHAT: 'WeChat',
|
|
126
|
+
ETC: 'ETC',
|
|
127
|
+
SKT_ID: 'SkTid',
|
|
128
|
+
APPLE_ID: 'AppleId',
|
|
129
|
+
USER_ID: 'UserId',
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const ABConfig = {
|
|
133
|
+
IOS_LOG_ENABLE: 'setLog',
|
|
134
|
+
ANDROID_LOG_ENABLE: 'android_log_enable',
|
|
135
|
+
ANDROID_LOG_LEVEL: 'android_log_level',
|
|
136
|
+
ANDROID_COLLECT_GOOGLE_ADVERTISING_ID: 'android_collect_google_advertising_id',
|
|
137
|
+
IOS_TRACKING_TIMEOUT: 'trackingAuthorizeTimeOut',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const ABDeepLinkResult = {
|
|
141
|
+
PROCESSED: 0,
|
|
142
|
+
ORGANIC: 1,
|
|
143
|
+
TRACKING_LINK_SETTINGS_INCORRECTLY: 2,
|
|
144
|
+
ORGANIC_NCPI_IN_PROCESS: 3,
|
|
145
|
+
NO_CONVERSION: -1,
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const ABAndroidLogLevel = {
|
|
149
|
+
VERBOSE: 2,
|
|
150
|
+
DEBUG: 3,
|
|
151
|
+
INFO: 4,
|
|
152
|
+
WARN: 5,
|
|
153
|
+
ERROR: 6,
|
|
154
|
+
ASSERT_LEVEL: 7,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const ABiOSTrackingTimeout = {
|
|
158
|
+
TIMEOUT_60: 60,
|
|
159
|
+
TIMEOUT_120: 120,
|
|
160
|
+
TIMEOUT_180: 180,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default {
|
|
164
|
+
ABEvent,
|
|
165
|
+
ABEventProperty,
|
|
166
|
+
ABCurrency,
|
|
167
|
+
ABInviteChannel,
|
|
168
|
+
ABPaymentMethod,
|
|
169
|
+
ABSharingChannel,
|
|
170
|
+
ABSignUpChannel,
|
|
171
|
+
ABConfig,
|
|
172
|
+
ABDeepLinkResult,
|
|
173
|
+
ABAndroidLogLevel,
|
|
174
|
+
ABiOSTrackingTimeout,
|
|
175
|
+
};
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
export declare class AdbrixDeepLinkCallback {
|
|
2
|
+
constructor(result: number, deepLink: string);
|
|
3
|
+
readonly result: number;
|
|
4
|
+
readonly deepLink: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare class Adbrix {
|
|
8
|
+
static init(params: {
|
|
9
|
+
applicationKey: string;
|
|
10
|
+
secretKey: string;
|
|
11
|
+
}): void;
|
|
12
|
+
|
|
13
|
+
static initWithConfig(params: {
|
|
14
|
+
applicationKey: string;
|
|
15
|
+
secretKey: string;
|
|
16
|
+
config?: Record<string, any> | null;
|
|
17
|
+
}): void;
|
|
18
|
+
|
|
19
|
+
static logEvent(params: {
|
|
20
|
+
eventName: string;
|
|
21
|
+
properties?: Record<string, any> | null;
|
|
22
|
+
}): void;
|
|
23
|
+
|
|
24
|
+
static enableSDK(): void;
|
|
25
|
+
static disableSDK(): void;
|
|
26
|
+
|
|
27
|
+
static blockDeferredDeepLinkLaunch(): Promise<AdbrixDeepLinkCallback | null>;
|
|
28
|
+
|
|
29
|
+
static attAuthorized(authorized: boolean): void;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ABEventType {
|
|
34
|
+
LOGIN: string;
|
|
35
|
+
LOGOUT: string;
|
|
36
|
+
SIGN_UP: string;
|
|
37
|
+
USE_CREDIT: string;
|
|
38
|
+
APP_UPDATE: string;
|
|
39
|
+
INVITE: string;
|
|
40
|
+
PURCHASE: string;
|
|
41
|
+
LEVEL_ACHIEVED: string;
|
|
42
|
+
TUTORIAL_COMPLETED: string;
|
|
43
|
+
CHARACTER_CREATED: string;
|
|
44
|
+
STAGE_CLEARED: string;
|
|
45
|
+
REFUND: string;
|
|
46
|
+
ADD_TO_CART: string;
|
|
47
|
+
ADD_TO_WISHLIST: string;
|
|
48
|
+
PRODUCT_VIEW: string;
|
|
49
|
+
CATEGORY_VIEW: string;
|
|
50
|
+
REVIEW_ORDER: string;
|
|
51
|
+
SEARCH: string;
|
|
52
|
+
SHARE: string;
|
|
53
|
+
VIEW_HOME: string;
|
|
54
|
+
LIST_VIEW: string;
|
|
55
|
+
CART_VIEW: string;
|
|
56
|
+
PAYMENT_INFO_ADDED: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ABEventPropertyType {
|
|
60
|
+
IS_SKIP: string;
|
|
61
|
+
LEVEL: string;
|
|
62
|
+
STAGE: string;
|
|
63
|
+
PREV_VER: string;
|
|
64
|
+
CURR_VER: string;
|
|
65
|
+
KEYWORD: string;
|
|
66
|
+
SHARING_CHANNEL: string;
|
|
67
|
+
SIGN_CHANNEL: string;
|
|
68
|
+
INVITE_CHANNEL: string;
|
|
69
|
+
ORDER_ID: string;
|
|
70
|
+
DELIVERY_CHARGE: string;
|
|
71
|
+
PENALTY_CHARGE: string;
|
|
72
|
+
PAYMENT_METHOD: string;
|
|
73
|
+
ORDER_SALES: string;
|
|
74
|
+
DISCOUNT: string;
|
|
75
|
+
CATEGORY1: string;
|
|
76
|
+
CATEGORY2: string;
|
|
77
|
+
CATEGORY3: string;
|
|
78
|
+
CATEGORY4: string;
|
|
79
|
+
CATEGORY5: string;
|
|
80
|
+
ITEMS: string;
|
|
81
|
+
ITEM_PRODUCT_ID: string;
|
|
82
|
+
ITEM_PRODUCT_NAME: string;
|
|
83
|
+
ITEM_PRICE: string;
|
|
84
|
+
ITEM_QUANTITY: string;
|
|
85
|
+
ITEM_DISCOUNT: string;
|
|
86
|
+
ITEM_CURRENCY: string;
|
|
87
|
+
ITEM_CATEGORY1: string;
|
|
88
|
+
ITEM_CATEGORY2: string;
|
|
89
|
+
ITEM_CATEGORY3: string;
|
|
90
|
+
ITEM_CATEGORY4: string;
|
|
91
|
+
ITEM_CATEGORY5: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ABCurrencyType {
|
|
95
|
+
KRW: string;
|
|
96
|
+
USD: string;
|
|
97
|
+
JPY: string;
|
|
98
|
+
EUR: string;
|
|
99
|
+
GBP: string;
|
|
100
|
+
CNY: string;
|
|
101
|
+
TWD: string;
|
|
102
|
+
HKD: string;
|
|
103
|
+
IDR: string;
|
|
104
|
+
INR: string;
|
|
105
|
+
RUB: string;
|
|
106
|
+
THB: string;
|
|
107
|
+
VND: string;
|
|
108
|
+
MYR: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ABConfigType {
|
|
112
|
+
IOS_LOG_ENABLE: string;
|
|
113
|
+
ANDROID_LOG_ENABLE: string;
|
|
114
|
+
ANDROID_LOG_LEVEL: string;
|
|
115
|
+
ANDROID_COLLECT_GOOGLE_ADVERTISING_ID: string;
|
|
116
|
+
IOS_TRACKING_TIMEOUT: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ABDeepLinkResultType {
|
|
120
|
+
PROCESSED: number;
|
|
121
|
+
ORGANIC: number;
|
|
122
|
+
TRACKING_LINK_SETTINGS_INCORRECTLY: number;
|
|
123
|
+
ORGANIC_NCPI_IN_PROCESS: number;
|
|
124
|
+
NO_CONVERSION: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ABAndroidLogLevelType {
|
|
128
|
+
VERBOSE: number;
|
|
129
|
+
DEBUG: number;
|
|
130
|
+
INFO: number;
|
|
131
|
+
WARN: number;
|
|
132
|
+
ERROR: number;
|
|
133
|
+
ASSERT_LEVEL: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface ABiOSTrackingTimeoutType {
|
|
137
|
+
TIMEOUT_60: number;
|
|
138
|
+
TIMEOUT_120: number;
|
|
139
|
+
TIMEOUT_180: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface ABInviteChannelType {
|
|
143
|
+
KAKAO: string;
|
|
144
|
+
NAVER: string;
|
|
145
|
+
LINE: string;
|
|
146
|
+
GOOGLE: string;
|
|
147
|
+
FACEBOOK: string;
|
|
148
|
+
TWITTER: string;
|
|
149
|
+
WHATS_APP: string;
|
|
150
|
+
QQ: string;
|
|
151
|
+
WE_CHAT: string;
|
|
152
|
+
ETC: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface ABPaymentMethodType {
|
|
156
|
+
CREDIT_CARD: string;
|
|
157
|
+
BANK_TRANSFER: string;
|
|
158
|
+
MOBILE_PAYMENT: string;
|
|
159
|
+
GIFT_CARD: string;
|
|
160
|
+
PAYPAL: string;
|
|
161
|
+
POINTS: string;
|
|
162
|
+
ETC: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface ABSharingChannelType {
|
|
166
|
+
FACEBOOK: string;
|
|
167
|
+
KAKAO_TALK: string;
|
|
168
|
+
KAKAO_STORY: string;
|
|
169
|
+
LINE: string;
|
|
170
|
+
WHATS_APP: string;
|
|
171
|
+
QQ: string;
|
|
172
|
+
WE_CHAT: string;
|
|
173
|
+
SMS: string;
|
|
174
|
+
EMAIL: string;
|
|
175
|
+
COPY_URL: string;
|
|
176
|
+
ETC: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface ABSignUpChannelType {
|
|
180
|
+
KAKAO: string;
|
|
181
|
+
NAVER: string;
|
|
182
|
+
LINE: string;
|
|
183
|
+
GOOGLE: string;
|
|
184
|
+
FACEBOOK: string;
|
|
185
|
+
TWITTER: string;
|
|
186
|
+
WHATS_APP: string;
|
|
187
|
+
QQ: string;
|
|
188
|
+
WE_CHAT: string;
|
|
189
|
+
ETC: string;
|
|
190
|
+
SKT_ID: string;
|
|
191
|
+
APPLE_ID: string;
|
|
192
|
+
USER_ID: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export declare const ABEvent: ABEventType;
|
|
196
|
+
export declare const ABEventProperty: ABEventPropertyType;
|
|
197
|
+
export declare const ABCurrency: ABCurrencyType;
|
|
198
|
+
export declare const ABInviteChannel: ABInviteChannelType;
|
|
199
|
+
export declare const ABPaymentMethod: ABPaymentMethodType;
|
|
200
|
+
export declare const ABSharingChannel: ABSharingChannelType;
|
|
201
|
+
export declare const ABSignUpChannel: ABSignUpChannelType;
|
|
202
|
+
export declare const ABConfig: ABConfigType;
|
|
203
|
+
export declare const ABDeepLinkResult: ABDeepLinkResultType;
|
|
204
|
+
export declare const ABAndroidLogLevel: ABAndroidLogLevelType;
|
|
205
|
+
export declare const ABiOSTrackingTimeout: ABiOSTrackingTimeoutType;
|
|
206
|
+
|
|
207
|
+
export type ABCurrencyValue = ABCurrencyType[keyof ABCurrencyType];
|
|
208
|
+
export type ABInviteChannelValue = ABInviteChannelType[keyof ABInviteChannelType];
|
|
209
|
+
export type ABPaymentMethodValue = ABPaymentMethodType[keyof ABPaymentMethodType];
|
|
210
|
+
export type ABSharingChannelValue = ABSharingChannelType[keyof ABSharingChannelType];
|
|
211
|
+
export type ABSignUpChannelValue = ABSignUpChannelType[keyof ABSignUpChannelType];
|
|
212
|
+
|
|
213
|
+
export interface TypedValue {
|
|
214
|
+
value: any;
|
|
215
|
+
type: 'string' | 'long' | 'double' | 'boolean';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export declare class ItemBuilder {
|
|
219
|
+
productId(value: string): ItemBuilder;
|
|
220
|
+
productName(value: string): ItemBuilder;
|
|
221
|
+
price(value: number): ItemBuilder;
|
|
222
|
+
discount(value: number): ItemBuilder;
|
|
223
|
+
quantity(value: number): ItemBuilder;
|
|
224
|
+
category1(value: string): ItemBuilder;
|
|
225
|
+
category2(value: string): ItemBuilder;
|
|
226
|
+
category3(value: string): ItemBuilder;
|
|
227
|
+
category4(value: string): ItemBuilder;
|
|
228
|
+
category5(value: string): ItemBuilder;
|
|
229
|
+
currency(value: ABCurrencyValue): ItemBuilder;
|
|
230
|
+
|
|
231
|
+
customString(key: string, value: string): ItemBuilder;
|
|
232
|
+
customLong(key: string, value: number): ItemBuilder;
|
|
233
|
+
customDouble(key: string, value: number): ItemBuilder;
|
|
234
|
+
customBool(key: string, value: boolean): ItemBuilder;
|
|
235
|
+
|
|
236
|
+
build(): Record<string, TypedValue>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export declare class PropertiesBuilder {
|
|
240
|
+
items(itemsInput: Array<Record<string, TypedValue> | Record<string, any>> | Record<string, TypedValue> | Record<string, any>): PropertiesBuilder;
|
|
241
|
+
|
|
242
|
+
// Order 관련
|
|
243
|
+
orderId(value: string): PropertiesBuilder;
|
|
244
|
+
orderSales(value: number): PropertiesBuilder;
|
|
245
|
+
deliveryCharge(value: number): PropertiesBuilder;
|
|
246
|
+
penaltyCharge(value: number): PropertiesBuilder;
|
|
247
|
+
paymentMethod(value: ABPaymentMethodValue): PropertiesBuilder;
|
|
248
|
+
discount(value: number): PropertiesBuilder;
|
|
249
|
+
|
|
250
|
+
// User 관련
|
|
251
|
+
signChannel(value: ABSignUpChannelValue): PropertiesBuilder;
|
|
252
|
+
inviteChannel(value: ABInviteChannelValue): PropertiesBuilder;
|
|
253
|
+
sharingChannel(value: ABSharingChannelValue): PropertiesBuilder;
|
|
254
|
+
|
|
255
|
+
// Common
|
|
256
|
+
category1(value: string): PropertiesBuilder;
|
|
257
|
+
category2(value: string): PropertiesBuilder;
|
|
258
|
+
category3(value: string): PropertiesBuilder;
|
|
259
|
+
category4(value: string): PropertiesBuilder;
|
|
260
|
+
category5(value: string): PropertiesBuilder;
|
|
261
|
+
keyword(value: string): PropertiesBuilder;
|
|
262
|
+
|
|
263
|
+
// Version
|
|
264
|
+
prevVer(value: string): PropertiesBuilder;
|
|
265
|
+
currVer(value: string): PropertiesBuilder;
|
|
266
|
+
|
|
267
|
+
// Game
|
|
268
|
+
level(value: number): PropertiesBuilder;
|
|
269
|
+
stage(value: string): PropertiesBuilder;
|
|
270
|
+
isSkip(value: boolean): PropertiesBuilder;
|
|
271
|
+
|
|
272
|
+
// Custom
|
|
273
|
+
customDouble(key: string, value: number): PropertiesBuilder;
|
|
274
|
+
customLong(key: string, value: number): PropertiesBuilder;
|
|
275
|
+
customString(key: string, value: string): PropertiesBuilder;
|
|
276
|
+
customBool(key: string, value: boolean): PropertiesBuilder;
|
|
277
|
+
|
|
278
|
+
build(): Record<string, TypedValue>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface PropertiesType {
|
|
282
|
+
items: (itemsInput: Array<Record<string, TypedValue> | Record<string, any>> | Record<string, TypedValue> | Record<string, any>) => PropertiesBuilder;
|
|
283
|
+
orderId: (value: string) => PropertiesBuilder;
|
|
284
|
+
orderSales: (value: number) => PropertiesBuilder;
|
|
285
|
+
deliveryCharge: (value: number) => PropertiesBuilder;
|
|
286
|
+
penaltyCharge: (value: number) => PropertiesBuilder;
|
|
287
|
+
paymentMethod: (value: ABPaymentMethodValue) => PropertiesBuilder;
|
|
288
|
+
discount: (value: number) => PropertiesBuilder;
|
|
289
|
+
signChannel: (value: ABSignUpChannelValue) => PropertiesBuilder;
|
|
290
|
+
inviteChannel: (value: ABInviteChannelValue) => PropertiesBuilder;
|
|
291
|
+
sharingChannel: (value: ABSharingChannelValue) => PropertiesBuilder;
|
|
292
|
+
category1: (value: string) => PropertiesBuilder;
|
|
293
|
+
category2: (value: string) => PropertiesBuilder;
|
|
294
|
+
category3: (value: string) => PropertiesBuilder;
|
|
295
|
+
category4: (value: string) => PropertiesBuilder;
|
|
296
|
+
category5: (value: string) => PropertiesBuilder;
|
|
297
|
+
keyword: (value: string) => PropertiesBuilder;
|
|
298
|
+
prevVer: (value: string) => PropertiesBuilder;
|
|
299
|
+
currVer: (value: string) => PropertiesBuilder;
|
|
300
|
+
level: (value: number) => PropertiesBuilder;
|
|
301
|
+
stage: (value: string) => PropertiesBuilder;
|
|
302
|
+
isSkip: (value: boolean) => PropertiesBuilder;
|
|
303
|
+
customDouble: (key: string, value: number) => PropertiesBuilder;
|
|
304
|
+
customLong: (key: string, value: number) => PropertiesBuilder;
|
|
305
|
+
customString: (key: string, value: string) => PropertiesBuilder;
|
|
306
|
+
customBool: (key: string, value: boolean) => PropertiesBuilder;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export declare const ABProperty: PropertiesType;
|
|
310
|
+
export declare const ABItem: () => ItemBuilder;
|
|
311
|
+
|
|
312
|
+
export default Adbrix;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
|
|
2
|
+
import { NativeModules, Platform } from 'react-native';
|
|
3
|
+
import { ABProperty, ABItem } from './properties';
|
|
4
|
+
|
|
5
|
+
const { Adbrix: AdbrixNativeModule } = NativeModules;
|
|
6
|
+
|
|
7
|
+
export class AdbrixDeepLinkCallback {
|
|
8
|
+
constructor(result, deepLink) {
|
|
9
|
+
this._result = result;
|
|
10
|
+
this._deepLink = deepLink;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get result() {
|
|
14
|
+
return this._result;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get deepLink() {
|
|
18
|
+
return this._deepLink;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class Adbrix {
|
|
23
|
+
|
|
24
|
+
static init({ applicationKey, secretKey }) {
|
|
25
|
+
if (!applicationKey || !secretKey) {
|
|
26
|
+
console.error('[Adbrix] init: applicationKey and secretKey are required');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (AdbrixNativeModule && AdbrixNativeModule.init) {
|
|
31
|
+
return AdbrixNativeModule.init({
|
|
32
|
+
applicationKey,
|
|
33
|
+
secretKey,
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
console.warn('[Adbrix] Native module not available');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static initWithConfig({ applicationKey, secretKey, config = null }) {
|
|
41
|
+
if (!applicationKey || !secretKey) {
|
|
42
|
+
console.error('[Adbrix] initWithConfig: applicationKey and secretKey are required');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (AdbrixNativeModule && AdbrixNativeModule.initWithConfig) {
|
|
47
|
+
return AdbrixNativeModule.initWithConfig({
|
|
48
|
+
applicationKey,
|
|
49
|
+
secretKey,
|
|
50
|
+
config,
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
console.warn('[Adbrix] Native module not available');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static logEvent({ eventName, properties = null }) {
|
|
58
|
+
if (!eventName) {
|
|
59
|
+
console.warn('[Adbrix] logEvent: eventName is required');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const params = { eventName };
|
|
64
|
+
if (properties) {
|
|
65
|
+
params.properties = properties;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (AdbrixNativeModule && AdbrixNativeModule.logEvent) {
|
|
69
|
+
return AdbrixNativeModule.logEvent(params);
|
|
70
|
+
} else {
|
|
71
|
+
console.warn('[Adbrix] Native module not available');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static enableSDK() {
|
|
76
|
+
if (AdbrixNativeModule && AdbrixNativeModule.enableSDK) {
|
|
77
|
+
return AdbrixNativeModule.enableSDK();
|
|
78
|
+
} else {
|
|
79
|
+
console.warn('[Adbrix] Native module not available');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static disableSDK() {
|
|
84
|
+
if (AdbrixNativeModule && AdbrixNativeModule.disableSDK) {
|
|
85
|
+
return AdbrixNativeModule.disableSDK();
|
|
86
|
+
} else {
|
|
87
|
+
console.warn('[Adbrix] Native module not available');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static async blockDeferredDeepLinkLaunch() {
|
|
92
|
+
if (AdbrixNativeModule && AdbrixNativeModule.blockDeferredDeepLinkLaunch) {
|
|
93
|
+
try {
|
|
94
|
+
const callback = await AdbrixNativeModule.blockDeferredDeepLinkLaunch();
|
|
95
|
+
if (callback == null) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return new AdbrixDeepLinkCallback(callback.result, callback.deepLink);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error('[Adbrix] blockDeferredDeepLinkLaunch error:', error);
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
console.warn('[Adbrix] Native module not available');
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static attAuthorized(authorized) {
|
|
110
|
+
if (Platform.OS === 'ios') {
|
|
111
|
+
if (AdbrixNativeModule && AdbrixNativeModule.attAuthorized) {
|
|
112
|
+
return AdbrixNativeModule.attAuthorized(authorized);
|
|
113
|
+
} else {
|
|
114
|
+
console.warn('[Adbrix] Native module not available');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export * from './constants';
|
|
122
|
+
export { ABProperty, ABItem } from './properties';
|
|
123
|
+
|
|
124
|
+
export default Adbrix;
|