@adstage/react-native-sdk 1.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 +21 -0
- package/README.md +327 -0
- package/adstage-react-native.podspec +24 -0
- package/android/build.gradle +66 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/io/nbase/adstage/reactnative/AdStageModule.kt +701 -0
- package/android/src/main/java/io/nbase/adstage/reactnative/AdStagePackage.kt +24 -0
- package/ios/AdStageModule.m +70 -0
- package/ios/AdStageModule.swift +457 -0
- package/lib/commonjs/AdStage.js +213 -0
- package/lib/commonjs/AdStage.js.map +1 -0
- package/lib/commonjs/deeplink/AdStageDeepLink.js +235 -0
- package/lib/commonjs/deeplink/AdStageDeepLink.js.map +1 -0
- package/lib/commonjs/event/AdStageEvent.js +689 -0
- package/lib/commonjs/event/AdStageEvent.js.map +1 -0
- package/lib/commonjs/index.js +34 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/promotion/AdStagePromotion.js +158 -0
- package/lib/commonjs/promotion/AdStagePromotion.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/AdStage.js +206 -0
- package/lib/module/AdStage.js.map +1 -0
- package/lib/module/deeplink/AdStageDeepLink.js +228 -0
- package/lib/module/deeplink/AdStageDeepLink.js.map +1 -0
- package/lib/module/event/AdStageEvent.js +682 -0
- package/lib/module/event/AdStageEvent.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/promotion/AdStagePromotion.js +151 -0
- package/lib/module/promotion/AdStagePromotion.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/AdStage.d.ts +124 -0
- package/lib/typescript/src/AdStage.d.ts.map +1 -0
- package/lib/typescript/src/deeplink/AdStageDeepLink.d.ts +154 -0
- package/lib/typescript/src/deeplink/AdStageDeepLink.d.ts.map +1 -0
- package/lib/typescript/src/event/AdStageEvent.d.ts +426 -0
- package/lib/typescript/src/event/AdStageEvent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +13 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/promotion/AdStagePromotion.d.ts +98 -0
- package/lib/typescript/src/promotion/AdStagePromotion.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +305 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +105 -0
- package/src/AdStage.ts +212 -0
- package/src/deeplink/AdStageDeepLink.ts +246 -0
- package/src/event/AdStageEvent.ts +844 -0
- package/src/index.ts +48 -0
- package/src/promotion/AdStagePromotion.ts +162 -0
- package/src/types.ts +392 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdStage React Native SDK
|
|
3
|
+
*
|
|
4
|
+
* 광고 어트리뷰션, 딥링크, 프로모션을 위한 통합 SDK
|
|
5
|
+
*
|
|
6
|
+
* @since 3.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { AdStage } from './AdStage';
|
|
10
|
+
export { AdStageDeepLink } from './deeplink/AdStageDeepLink';
|
|
11
|
+
export { AdStagePromotion } from './promotion/AdStagePromotion';
|
|
12
|
+
export { AdStageEvent } from './event/AdStageEvent';
|
|
13
|
+
|
|
14
|
+
// Types
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AdStage","AdStageDeepLink","AdStagePromotion","AdStageEvent"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,YAAY,QAAQ,sBAAsB;;AAEnD","ignoreList":[]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdStage Promotion 모듈
|
|
3
|
+
*
|
|
4
|
+
* 프로모션 조회, 표시, 클릭 처리를 담당합니다.
|
|
5
|
+
* Android/iOS PromotionHandler, PromotionManager와 동일한 API를 제공합니다.
|
|
6
|
+
*
|
|
7
|
+
* @since 3.0.0
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { NativeModules } from 'react-native';
|
|
11
|
+
const {
|
|
12
|
+
AdStageModule
|
|
13
|
+
} = NativeModules;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* AdStage Promotion 클래스
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // 프로모션 목록 조회
|
|
21
|
+
* const response = await AdStage.promotion.getList({
|
|
22
|
+
* bannerType: 'NATIVE',
|
|
23
|
+
* region: 'KR',
|
|
24
|
+
* limit: 10
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // 프로모션 클릭 처리
|
|
28
|
+
* const result = await AdStage.promotion.handleClick(response.promotions[0]);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export class AdStagePromotion {
|
|
32
|
+
// ============================================
|
|
33
|
+
// Promotion List
|
|
34
|
+
// ============================================
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 프로모션 목록 조회
|
|
38
|
+
*
|
|
39
|
+
* @param params - 조회 파라미터
|
|
40
|
+
* @returns 프로모션 목록 응답
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const response = await AdStage.promotion.getList({
|
|
45
|
+
* bannerType: 'NATIVE', // NATIVE, INTERSTITIAL, REWARDED_VIDEO, POPUP
|
|
46
|
+
* region: 'KR', // KR, JP, US, SEA, EU, GLOBAL
|
|
47
|
+
* deviceType: 'HIGH_END', // LOW_END, MID_END, HIGH_END
|
|
48
|
+
* limit: 10,
|
|
49
|
+
* status: 'ACTIVE',
|
|
50
|
+
* partner: 'game_company',
|
|
51
|
+
* primaryInterest: 'GAMES',
|
|
52
|
+
* primaryAgeGroup: '18-24',
|
|
53
|
+
* gameGenrePreference: 'RPG',
|
|
54
|
+
* playerSpendingTier: 'DOLPHIN', // F2P, DOLPHIN, WHALE
|
|
55
|
+
* playTimePattern: 'EVENING'
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* console.log('Total:', response.totalItems);
|
|
59
|
+
* response.promotions.forEach(promo => {
|
|
60
|
+
* console.log(`${promo.appName}: ${promo.bannerUrl}`);
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
static async getList(params = {}) {
|
|
65
|
+
if (!AdStageModule) {
|
|
66
|
+
throw new Error('AdStage: Native module is not available');
|
|
67
|
+
}
|
|
68
|
+
const result = await AdStageModule.getPromotionList(params);
|
|
69
|
+
return {
|
|
70
|
+
totalItems: result.totalItems ?? 0,
|
|
71
|
+
promotions: result.promotions ?? []
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ============================================
|
|
76
|
+
// Promotion Click Handling
|
|
77
|
+
// ============================================
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 프로모션 클릭 처리
|
|
81
|
+
*
|
|
82
|
+
* 클릭 이벤트를 서버에 전송하고 스토어를 엽니다.
|
|
83
|
+
*
|
|
84
|
+
* @param promotion - 클릭할 프로모션
|
|
85
|
+
* @returns 클릭 처리 결과
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const result = await AdStage.promotion.handleClick(promotion);
|
|
90
|
+
*
|
|
91
|
+
* if (result.success) {
|
|
92
|
+
* console.log('스토어로 이동:', result.storeUrl);
|
|
93
|
+
* } else {
|
|
94
|
+
* console.error('클릭 처리 실패:', result.error);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
static async handleClick(promotion) {
|
|
99
|
+
if (!AdStageModule) {
|
|
100
|
+
throw new Error('AdStage: Native module is not available');
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const result = await AdStageModule.handlePromotionClick(promotion);
|
|
104
|
+
return {
|
|
105
|
+
success: true,
|
|
106
|
+
storeUrl: result.storeUrl
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred'
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 프로모션 노출 이벤트 전송
|
|
118
|
+
*
|
|
119
|
+
* 프로모션이 화면에 표시될 때 호출합니다.
|
|
120
|
+
*
|
|
121
|
+
* @param promotion - 노출된 프로모션
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* // 프로모션 배너가 화면에 보일 때
|
|
126
|
+
* AdStage.promotion.trackImpression(promotion);
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
static async trackImpression(promotion) {
|
|
130
|
+
if (!AdStageModule) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
await AdStageModule.trackPromotionImpression?.(promotion);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ============================================
|
|
137
|
+
// Utility
|
|
138
|
+
// ============================================
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 플랫폼에 맞는 스토어 URL 추출
|
|
142
|
+
*
|
|
143
|
+
* @param promotion - 프로모션
|
|
144
|
+
* @returns 스토어 URL 또는 null
|
|
145
|
+
*/
|
|
146
|
+
static getStoreUrl(promotion) {
|
|
147
|
+
const platform = require('react-native').Platform.OS === 'ios' ? 'ios' : 'android';
|
|
148
|
+
return promotion.storeUrls?.[platform] ?? null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=AdStagePromotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","AdStageModule","AdStagePromotion","getList","params","Error","result","getPromotionList","totalItems","promotions","handleClick","promotion","handlePromotionClick","success","storeUrl","error","message","trackImpression","trackPromotionImpression","getStoreUrl","platform","require","Platform","OS","storeUrls"],"sourceRoot":"../../../src","sources":["promotion/AdStagePromotion.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,cAAc;AAQ5C,MAAM;EAAEC;AAAc,CAAC,GAAGD,aAAa;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,gBAAgB,CAAC;EAC5B;EACA;EACA;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,OAAOA,CAClBC,MAA2B,GAAG,CAAC,CAAC,EACA;IAChC,IAAI,CAACH,aAAa,EAAE;MAClB,MAAM,IAAII,KAAK,CAAC,yCAAyC,CAAC;IAC5D;IAEA,MAAMC,MAAM,GAAG,MAAML,aAAa,CAACM,gBAAgB,CAACH,MAAM,CAAC;IAE3D,OAAO;MACLI,UAAU,EAAEF,MAAM,CAACE,UAAU,IAAI,CAAC;MAClCC,UAAU,EAAEH,MAAM,CAACG,UAAU,IAAI;IACnC,CAAC;EACH;;EAEA;EACA;EACA;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,WAAWA,CAACC,SAAoB,EAAiC;IAC5E,IAAI,CAACV,aAAa,EAAE;MAClB,MAAM,IAAII,KAAK,CAAC,yCAAyC,CAAC;IAC5D;IAEA,IAAI;MACF,MAAMC,MAAM,GAAG,MAAML,aAAa,CAACW,oBAAoB,CAACD,SAAS,CAAC;MAClE,OAAO;QACLE,OAAO,EAAE,IAAI;QACbC,QAAQ,EAAER,MAAM,CAACQ;MACnB,CAAC;IACH,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,OAAO;QACLF,OAAO,EAAE,KAAK;QACdE,KAAK,EACHA,KAAK,YAAYV,KAAK,GAAGU,KAAK,CAACC,OAAO,GAAG;MAC7C,CAAC;IACH;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,eAAeA,CAACN,SAAoB,EAAiB;IAChE,IAAI,CAACV,aAAa,EAAE;MAClB;IACF;IACA,MAAMA,aAAa,CAACiB,wBAAwB,GAAGP,SAAS,CAAC;EAC3D;;EAEA;EACA;EACA;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOQ,WAAWA,CAACR,SAAoB,EAAiB;IACtD,MAAMS,QAAQ,GACZC,OAAO,CAAC,cAAc,CAAC,CAACC,QAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,KAAK,GAAG,SAAS;IACnE,OAAOZ,SAAS,CAACa,SAAS,GAAGJ,QAAQ,CAAC,IAAI,IAAI;EAChD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdStage SDK 메인 클래스
|
|
3
|
+
*
|
|
4
|
+
* React Native용 AdStage SDK의 통합 진입점입니다.
|
|
5
|
+
* Android/iOS 네이티브 SDK(AdStage, AdStageManager)와 동일한 API를 제공합니다.
|
|
6
|
+
*
|
|
7
|
+
* @since 3.0.0
|
|
8
|
+
*/
|
|
9
|
+
import { AdStageDeepLink } from './deeplink/AdStageDeepLink';
|
|
10
|
+
import { AdStagePromotion } from './promotion/AdStagePromotion';
|
|
11
|
+
import { AdStageEvent } from './event/AdStageEvent';
|
|
12
|
+
import type { AdStageConfig, UserAttributes } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* AdStage SDK
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // 초기화
|
|
19
|
+
* await AdStage.initialize({
|
|
20
|
+
* apiKey: 'your-api-key',
|
|
21
|
+
* serverUrl: 'https://api.adstage.app'
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // 딥링크 리스너 설정
|
|
25
|
+
* AdStage.deepLink.setListener((data) => {
|
|
26
|
+
* console.log('딥링크 수신:', data.shortPath);
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // 프로모션 조회
|
|
30
|
+
* const promotions = await AdStage.promotion.getList({ bannerType: 'NATIVE' });
|
|
31
|
+
*
|
|
32
|
+
* // 이벤트 전송
|
|
33
|
+
* await AdStage.event.trackPurchase({
|
|
34
|
+
* value: 29.99,
|
|
35
|
+
* currency: 'USD',
|
|
36
|
+
* transactionId: 'TX_123'
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class AdStage {
|
|
41
|
+
private static _isInitialized;
|
|
42
|
+
private static _config;
|
|
43
|
+
/** 딥링크 관련 기능 */
|
|
44
|
+
static readonly deepLink: typeof AdStageDeepLink;
|
|
45
|
+
/** 프로모션 관련 기능 */
|
|
46
|
+
static readonly promotion: typeof AdStagePromotion;
|
|
47
|
+
/** 이벤트 트래킹 관련 기능 */
|
|
48
|
+
static readonly event: typeof AdStageEvent;
|
|
49
|
+
/**
|
|
50
|
+
* AdStage SDK 초기화
|
|
51
|
+
*
|
|
52
|
+
* 앱 시작 시 가장 먼저 호출해야 합니다.
|
|
53
|
+
*
|
|
54
|
+
* @param config - SDK 설정
|
|
55
|
+
* @throws SDK 초기화 실패 시 에러
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* await AdStage.initialize({
|
|
60
|
+
* apiKey: 'your-api-key',
|
|
61
|
+
* serverUrl: 'https://your-server.com' // 선택사항, 없으면 네이티브 SDK 기본값 사용
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
static initialize(config: AdStageConfig): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* SDK 초기화 여부 확인
|
|
68
|
+
*
|
|
69
|
+
* @returns 초기화되었으면 true
|
|
70
|
+
*/
|
|
71
|
+
static isInitialized(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* SDK 버전 조회
|
|
74
|
+
*
|
|
75
|
+
* @returns SDK 버전 문자열
|
|
76
|
+
*/
|
|
77
|
+
static getVersion(): Promise<string>;
|
|
78
|
+
/**
|
|
79
|
+
* 전역 사용자 속성 설정
|
|
80
|
+
*
|
|
81
|
+
* 설정된 사용자 속성은 이후 모든 이벤트에 자동으로 포함됩니다.
|
|
82
|
+
*
|
|
83
|
+
* @param attributes - 사용자 속성
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* AdStage.setUserAttributes({
|
|
88
|
+
* gender: 'female',
|
|
89
|
+
* country: 'KR',
|
|
90
|
+
* city: 'Seoul',
|
|
91
|
+
* age: '28',
|
|
92
|
+
* language: 'ko-KR'
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
static setUserAttributes(attributes: UserAttributes): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* 전역 사용자 속성 조회
|
|
99
|
+
*
|
|
100
|
+
* @returns 설정된 사용자 속성 또는 null
|
|
101
|
+
*/
|
|
102
|
+
static getUserAttributes(): Promise<UserAttributes | null>;
|
|
103
|
+
/**
|
|
104
|
+
* 전역 사용자 속성 초기화
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* // 로그아웃 시
|
|
109
|
+
* await AdStage.clearUserAttributes();
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
static clearUserAttributes(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* 초기화 상태 검증
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
static ensureInitialized(): void;
|
|
118
|
+
/**
|
|
119
|
+
* 현재 설정 조회
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
static getConfig(): AdStageConfig | null;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=AdStage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdStage.d.ts","sourceRoot":"","sources":["../../../src/AdStage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI7D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,OAAO;IAKlB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAS;IACtC,OAAO,CAAC,MAAM,CAAC,OAAO,CAA8B;IAMpD,gBAAgB;IAChB,MAAM,CAAC,QAAQ,CAAC,QAAQ,yBAAmB;IAE3C,iBAAiB;IACjB,MAAM,CAAC,QAAQ,CAAC,SAAS,0BAAoB;IAE7C,oBAAoB;IACpB,MAAM,CAAC,QAAQ,CAAC,KAAK,sBAAgB;IAMrC;;;;;;;;;;;;;;;OAeG;WACU,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB7D;;;;OAIG;IACH,MAAM,CAAC,aAAa,IAAI,OAAO;IAI/B;;;;OAIG;WACU,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAW1C;;;;;;;;;;;;;;;;;OAiBG;WACU,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzE;;;;OAIG;WACU,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAOhE;;;;;;;;OAQG;WACU,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWjD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,IAAI,IAAI;IAQhC;;;OAGG;IACH,MAAM,CAAC,SAAS,IAAI,aAAa,GAAG,IAAI;CAGzC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdStage DeepLink 모듈
|
|
3
|
+
*
|
|
4
|
+
* 딥링크 생성, 수신, 처리를 담당합니다.
|
|
5
|
+
* Android DeeplinkHandler, iOS DeepLinkManager와 동일한 API를 제공합니다.
|
|
6
|
+
*
|
|
7
|
+
* @since 3.0.0
|
|
8
|
+
*/
|
|
9
|
+
import type { DeepLinkListener, CreateDeepLinkRequest, CreateDeepLinkResponse } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* AdStage DeepLink 클래스
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // 딥링크 리스너 설정
|
|
16
|
+
* const unsubscribe = AdStage.deepLink.setListener((data) => {
|
|
17
|
+
* console.log('딥링크 수신:', data.shortPath);
|
|
18
|
+
* console.log('파라미터:', data.parameters);
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // 딥링크 생성
|
|
22
|
+
* const result = await AdStage.deepLink.create({
|
|
23
|
+
* name: '여름 프로모션',
|
|
24
|
+
* channel: 'google-ads',
|
|
25
|
+
* campaign: 'summer_2024'
|
|
26
|
+
* });
|
|
27
|
+
* console.log('Short URL:', result.shortUrl);
|
|
28
|
+
*
|
|
29
|
+
* // 리스너 해제
|
|
30
|
+
* unsubscribe();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class AdStageDeepLink {
|
|
34
|
+
private static subscription;
|
|
35
|
+
/**
|
|
36
|
+
* 딥링크 리스너 설정
|
|
37
|
+
*
|
|
38
|
+
* 딥링크가 수신되면 콜백이 호출됩니다.
|
|
39
|
+
* 반환된 함수를 호출하면 리스너가 해제됩니다.
|
|
40
|
+
*
|
|
41
|
+
* @param listener - 딥링크 수신 콜백
|
|
42
|
+
* @returns 리스너 해제 함수
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const unsubscribe = AdStage.deepLink.setListener((data) => {
|
|
47
|
+
* // URL Scheme: myapp://adstage.net/ABCDEF
|
|
48
|
+
* // Universal Link: https://adstage.net/ABCDEF
|
|
49
|
+
* console.log('Short Path:', data.shortPath); // "ABCDEF"
|
|
50
|
+
* console.log('Link ID:', data.linkId);
|
|
51
|
+
* console.log('Parameters:', data.parameters);
|
|
52
|
+
* console.log('Source:', data.source); // "realtime" | "install"
|
|
53
|
+
* console.log('Event Type:', data.eventType); // "OPEN" | "INSTALL"
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* // 컴포넌트 unmount 시
|
|
57
|
+
* unsubscribe();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
static setListener(listener: DeepLinkListener): () => void;
|
|
61
|
+
/**
|
|
62
|
+
* 딥링크 리스너 제거
|
|
63
|
+
*/
|
|
64
|
+
static removeListener(): void;
|
|
65
|
+
/**
|
|
66
|
+
* 딥링크 생성
|
|
67
|
+
*
|
|
68
|
+
* @param request - 딥링크 생성 요청
|
|
69
|
+
* @returns 생성된 딥링크 정보
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const result = await AdStage.deepLink.create({
|
|
74
|
+
* name: '여름 프로모션 링크',
|
|
75
|
+
* description: '2024년 여름 시즌용',
|
|
76
|
+
* channel: 'google-ads',
|
|
77
|
+
* campaign: 'summer_promotion_2024',
|
|
78
|
+
* redirectConfig: {
|
|
79
|
+
* type: 'STORE',
|
|
80
|
+
* android: {
|
|
81
|
+
* packageName: 'com.example.app',
|
|
82
|
+
* appScheme: 'myapp://promo'
|
|
83
|
+
* },
|
|
84
|
+
* ios: {
|
|
85
|
+
* appStoreId: '123456789',
|
|
86
|
+
* appScheme: 'myapp://promo'
|
|
87
|
+
* }
|
|
88
|
+
* },
|
|
89
|
+
* parameters: {
|
|
90
|
+
* productId: 'SUMMER_2024',
|
|
91
|
+
* discount: '20'
|
|
92
|
+
* }
|
|
93
|
+
* });
|
|
94
|
+
*
|
|
95
|
+
* console.log('Short URL:', result.shortUrl); // https://adstage.net/ABCDEF
|
|
96
|
+
* console.log('Short Path:', result.shortPath); // ABCDEF
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
static create(request: CreateDeepLinkRequest): Promise<CreateDeepLinkResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Pending 딥링크 확인 및 처리
|
|
102
|
+
*
|
|
103
|
+
* 앱이 종료된 상태에서 딥링크로 실행된 경우,
|
|
104
|
+
* SDK 초기화 후 이 메서드를 호출하여 pending 딥링크를 처리합니다.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* // SDK 초기화 후
|
|
109
|
+
* await AdStage.initialize({ apiKey: '...' });
|
|
110
|
+
*
|
|
111
|
+
* // 리스너 설정
|
|
112
|
+
* AdStage.deepLink.setListener((data) => {
|
|
113
|
+
* console.log('딥링크:', data);
|
|
114
|
+
* });
|
|
115
|
+
*
|
|
116
|
+
* // Pending 딥링크 확인
|
|
117
|
+
* AdStage.deepLink.checkPendingDeepLink();
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
static checkPendingDeepLink(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Intent 처리 (Android 전용)
|
|
123
|
+
*
|
|
124
|
+
* MainActivity에서 새로운 Intent가 들어올 때 호출합니다.
|
|
125
|
+
* iOS에서는 호출해도 무시됩니다.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* // React Native에서 AppState 변경 감지
|
|
130
|
+
* import { Linking } from 'react-native';
|
|
131
|
+
*
|
|
132
|
+
* Linking.addEventListener('url', ({ url }) => {
|
|
133
|
+
* // Android에서는 네이티브에서 자동 처리되므로 필요 없음
|
|
134
|
+
* // 필요한 경우 수동 호출
|
|
135
|
+
* AdStage.deepLink.handleIntent();
|
|
136
|
+
* });
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
static handleIntent(): void;
|
|
140
|
+
/**
|
|
141
|
+
* URL에서 Short Path 추출
|
|
142
|
+
*
|
|
143
|
+
* @param url - 딥링크 URL
|
|
144
|
+
* @returns Short Path 또는 null
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const shortPath = AdStage.deepLink.extractShortPath('https://adstage.net/ABCDEF');
|
|
149
|
+
* console.log(shortPath); // "ABCDEF"
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
static extractShortPath(url: string): string | null;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=AdStageDeepLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdStageDeepLink.d.ts","sourceRoot":"","sources":["../../../../src/deeplink/AdStageDeepLink.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAEV,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAOlB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,YAAY,CAEX;IAMhB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAsB1D;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,IAAI;IAY7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;WACU,MAAM,CACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAsBlC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,oBAAoB,IAAI,IAAI;IAInC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,YAAY,IAAI,IAAI;IAM3B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAWpD"}
|