affise-attribution-lib 1.6.34 → 1.6.35
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/README.md +42 -13
- package/affise-attribution-native.podspec +1 -1
- package/android/build.gradle +1 -1
- package/lib/commonjs/Export.js +4 -4
- package/lib/commonjs/debug/AffiseDebug.js +49 -0
- package/lib/commonjs/debug/AffiseDebug.js.map +1 -0
- package/lib/commonjs/debug/AffiseDebugApi.js +6 -0
- package/lib/commonjs/debug/AffiseDebugApi.js.map +1 -0
- package/lib/commonjs/debug/internal.js +28 -0
- package/lib/commonjs/debug/internal.js.map +1 -0
- package/lib/commonjs/index.js +14 -138
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/module/AffiseModules.js +2 -0
- package/lib/commonjs/module/AffiseModules.js.map +1 -1
- package/lib/commonjs/module/appsflyer/AffiseAppsFlyer.js +26 -0
- package/lib/commonjs/module/appsflyer/AffiseAppsFlyer.js.map +1 -0
- package/lib/commonjs/module/appsflyer/AffiseModuleAppsFlyerApi.js +2 -0
- package/lib/commonjs/module/appsflyer/AffiseModuleAppsFlyerApi.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseAndroid.js +30 -0
- package/lib/commonjs/module/attribution/AffiseAndroid.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseAndroidApi.js +2 -0
- package/lib/commonjs/module/attribution/AffiseAndroidApi.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseIos.js +50 -0
- package/lib/commonjs/module/attribution/AffiseIos.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseIosApi.js +6 -0
- package/lib/commonjs/module/attribution/AffiseIosApi.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseModule.js +81 -0
- package/lib/commonjs/module/attribution/AffiseModule.js.map +1 -0
- package/lib/commonjs/module/attribution/AffiseModuleApi.js +6 -0
- package/lib/commonjs/module/attribution/AffiseModuleApi.js.map +1 -0
- package/lib/commonjs/module/internal.js +72 -0
- package/lib/commonjs/module/internal.js.map +1 -0
- package/lib/commonjs/module/link/AffiseLink.js +26 -0
- package/lib/commonjs/module/link/AffiseLink.js.map +1 -0
- package/lib/commonjs/module/link/AffiseModuleLinkApi.js +6 -0
- package/lib/commonjs/module/link/AffiseModuleLinkApi.js.map +1 -0
- package/lib/commonjs/module/subscription/AffiseModuleSubscriptionApi.js +6 -0
- package/lib/commonjs/module/subscription/AffiseModuleSubscriptionApi.js.map +1 -0
- package/lib/commonjs/module/subscription/AffiseSubscription.js +36 -0
- package/lib/commonjs/module/subscription/AffiseSubscription.js.map +1 -0
- package/lib/commonjs/native/AffiseApiMethod.js +1 -0
- package/lib/commonjs/native/AffiseApiMethod.js.map +1 -1
- package/lib/commonjs/native/AffiseNative.js +9 -0
- package/lib/commonjs/native/AffiseNative.js.map +1 -1
- package/lib/commonjs/native/data/DataName.js +2 -0
- package/lib/commonjs/native/data/DataName.js.map +1 -1
- package/lib/commonjs/parameters/ProviderType.js +1 -0
- package/lib/commonjs/parameters/ProviderType.js.map +1 -1
- package/lib/commonjs/settings/AffiseSettings.js +6 -4
- package/lib/commonjs/settings/AffiseSettings.js.map +1 -1
- package/lib/commonjs/settings/AffiseSettingsApi.js +6 -0
- package/lib/commonjs/settings/AffiseSettingsApi.js.map +1 -0
- package/lib/module/Export.js +1 -1
- package/lib/module/Export.js.map +1 -1
- package/lib/module/debug/AffiseDebug.js +42 -0
- package/lib/module/debug/AffiseDebug.js.map +1 -0
- package/lib/module/debug/AffiseDebugApi.js +2 -0
- package/lib/module/debug/AffiseDebugApi.js.map +1 -0
- package/lib/module/debug/internal.js +3 -0
- package/lib/module/debug/internal.js.map +1 -0
- package/lib/module/index.js +14 -139
- package/lib/module/index.js.map +1 -1
- package/lib/module/module/AffiseModules.js +2 -0
- package/lib/module/module/AffiseModules.js.map +1 -1
- package/lib/module/module/appsflyer/AffiseAppsFlyer.js +19 -0
- package/lib/module/module/appsflyer/AffiseAppsFlyer.js.map +1 -0
- package/lib/module/module/appsflyer/AffiseModuleAppsFlyerApi.js +2 -0
- package/lib/module/module/appsflyer/AffiseModuleAppsFlyerApi.js.map +1 -0
- package/lib/module/module/attribution/AffiseAndroid.js +23 -0
- package/lib/module/module/attribution/AffiseAndroid.js.map +1 -0
- package/lib/module/module/attribution/AffiseAndroidApi.js +2 -0
- package/lib/module/module/attribution/AffiseAndroidApi.js.map +1 -0
- package/lib/module/module/attribution/AffiseIos.js +43 -0
- package/lib/module/module/attribution/AffiseIos.js.map +1 -0
- package/lib/module/module/attribution/AffiseIosApi.js +2 -0
- package/lib/module/module/attribution/AffiseIosApi.js.map +1 -0
- package/lib/module/module/attribution/AffiseModule.js +74 -0
- package/lib/module/module/attribution/AffiseModule.js.map +1 -0
- package/lib/module/module/attribution/AffiseModuleApi.js +2 -0
- package/lib/module/module/attribution/AffiseModuleApi.js.map +1 -0
- package/lib/module/module/internal.js +7 -0
- package/lib/module/module/internal.js.map +1 -0
- package/lib/module/module/link/AffiseLink.js +19 -0
- package/lib/module/module/link/AffiseLink.js.map +1 -0
- package/lib/module/module/link/AffiseModuleLinkApi.js +2 -0
- package/lib/module/module/link/AffiseModuleLinkApi.js.map +1 -0
- package/lib/module/module/subscription/AffiseModuleSubscriptionApi.js +2 -0
- package/lib/module/module/subscription/AffiseModuleSubscriptionApi.js.map +1 -0
- package/lib/module/module/subscription/AffiseSubscription.js +29 -0
- package/lib/module/module/subscription/AffiseSubscription.js.map +1 -0
- package/lib/module/native/AffiseApiMethod.js +1 -0
- package/lib/module/native/AffiseApiMethod.js.map +1 -1
- package/lib/module/native/AffiseNative.js +9 -0
- package/lib/module/native/AffiseNative.js.map +1 -1
- package/lib/module/native/data/DataName.js +2 -0
- package/lib/module/native/data/DataName.js.map +1 -1
- package/lib/module/parameters/ProviderType.js +1 -0
- package/lib/module/parameters/ProviderType.js.map +1 -1
- package/lib/module/settings/AffiseSettings.js +7 -5
- package/lib/module/settings/AffiseSettings.js.map +1 -1
- package/lib/module/settings/AffiseSettingsApi.js +2 -0
- package/lib/module/settings/AffiseSettingsApi.js.map +1 -0
- package/lib/typescript/Export.d.ts +1 -1
- package/lib/typescript/Export.d.ts.map +1 -1
- package/lib/typescript/debug/AffiseDebug.d.ts +29 -0
- package/lib/typescript/debug/AffiseDebug.d.ts.map +1 -0
- package/lib/typescript/debug/AffiseDebugApi.d.ts +25 -0
- package/lib/typescript/debug/AffiseDebugApi.d.ts.map +1 -0
- package/lib/typescript/debug/internal.d.ts +3 -0
- package/lib/typescript/debug/internal.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +10 -93
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/module/AffiseModules.d.ts +2 -0
- package/lib/typescript/module/AffiseModules.d.ts.map +1 -1
- package/lib/typescript/module/appsflyer/AffiseAppsFlyer.d.ts +13 -0
- package/lib/typescript/module/appsflyer/AffiseAppsFlyer.d.ts.map +1 -0
- package/lib/typescript/module/appsflyer/AffiseModuleAppsFlyerApi.d.ts +9 -0
- package/lib/typescript/module/appsflyer/AffiseModuleAppsFlyerApi.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseAndroid.d.ts +12 -0
- package/lib/typescript/module/attribution/AffiseAndroid.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseAndroidApi.d.ts +8 -0
- package/lib/typescript/module/attribution/AffiseAndroidApi.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseIos.d.ts +29 -0
- package/lib/typescript/module/attribution/AffiseIos.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseIosApi.d.ts +25 -0
- package/lib/typescript/module/attribution/AffiseIosApi.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseModule.d.ts +58 -0
- package/lib/typescript/module/attribution/AffiseModule.d.ts.map +1 -0
- package/lib/typescript/module/attribution/AffiseModuleApi.d.ts +54 -0
- package/lib/typescript/module/attribution/AffiseModuleApi.d.ts.map +1 -0
- package/lib/typescript/module/internal.d.ts +7 -0
- package/lib/typescript/module/internal.d.ts.map +1 -0
- package/lib/typescript/module/link/AffiseLink.d.ts +14 -0
- package/lib/typescript/module/link/AffiseLink.d.ts.map +1 -0
- package/lib/typescript/module/link/AffiseModuleLinkApi.d.ts +10 -0
- package/lib/typescript/module/link/AffiseModuleLinkApi.d.ts.map +1 -0
- package/lib/typescript/module/subscription/AffiseModuleSubscriptionApi.d.ts +21 -0
- package/lib/typescript/module/subscription/AffiseModuleSubscriptionApi.d.ts.map +1 -0
- package/lib/typescript/module/subscription/AffiseSubscription.d.ts +25 -0
- package/lib/typescript/module/subscription/AffiseSubscription.d.ts.map +1 -0
- package/lib/typescript/native/AffiseApiMethod.d.ts +1 -0
- package/lib/typescript/native/AffiseApiMethod.d.ts.map +1 -1
- package/lib/typescript/native/AffiseNative.d.ts +1 -0
- package/lib/typescript/native/AffiseNative.d.ts.map +1 -1
- package/lib/typescript/native/data/DataName.d.ts +2 -0
- package/lib/typescript/native/data/DataName.d.ts.map +1 -1
- package/lib/typescript/parameters/ProviderType.d.ts +1 -0
- package/lib/typescript/parameters/ProviderType.d.ts.map +1 -1
- package/lib/typescript/settings/AffiseSettings.d.ts +14 -11
- package/lib/typescript/settings/AffiseSettings.d.ts.map +1 -1
- package/lib/typescript/settings/AffiseSettingsApi.d.ts +67 -0
- package/lib/typescript/settings/AffiseSettingsApi.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/Export.ts +3 -3
- package/src/debug/AffiseDebug.ts +45 -0
- package/src/debug/AffiseDebugApi.ts +29 -0
- package/src/debug/internal.ts +2 -0
- package/src/index.ts +29 -152
- package/src/module/AffiseModules.ts +2 -0
- package/src/module/appsflyer/AffiseAppsFlyer.ts +19 -0
- package/src/module/appsflyer/AffiseModuleAppsFlyerApi.ts +8 -0
- package/src/module/attribution/AffiseAndroid.ts +25 -0
- package/src/module/attribution/AffiseAndroidApi.ts +8 -0
- package/src/module/attribution/AffiseIos.ts +48 -0
- package/src/module/attribution/AffiseIosApi.ts +28 -0
- package/src/module/attribution/AffiseModule.ts +86 -0
- package/src/module/attribution/AffiseModuleApi.ts +61 -0
- package/src/module/internal.ts +8 -0
- package/src/module/link/AffiseLink.ts +20 -0
- package/src/module/link/AffiseModuleLinkApi.ts +10 -0
- package/src/module/subscription/AffiseModuleSubscriptionApi.ts +22 -0
- package/src/module/subscription/AffiseSubscription.ts +34 -0
- package/src/native/AffiseApiMethod.ts +2 -0
- package/src/native/AffiseNative.ts +9 -0
- package/src/native/data/DataName.ts +3 -0
- package/src/parameters/ProviderType.ts +3 -0
- package/src/settings/AffiseSettings.ts +18 -15
- package/src/settings/AffiseSettingsApi.ts +84 -0
package/src/index.ts
CHANGED
|
@@ -4,22 +4,28 @@ import type {
|
|
|
4
4
|
AffiseInitProperties,
|
|
5
5
|
// AutoCatchingType,
|
|
6
6
|
ReferrerKey,
|
|
7
|
-
CoarseValue,
|
|
8
7
|
AffiseModules,
|
|
9
8
|
ReferrerCallback,
|
|
10
9
|
OnKeyValueCallback,
|
|
11
|
-
ErrorCallback,
|
|
12
10
|
OnDeeplinkCallback,
|
|
13
|
-
DebugOnValidateCallback,
|
|
14
|
-
DebugOnNetworkCallback,
|
|
15
11
|
OnSendSuccessCallback,
|
|
16
12
|
OnSendFailedCallback,
|
|
17
|
-
AffiseLinkCallback,
|
|
18
|
-
AffiseResultCallback,
|
|
19
13
|
} from "./Export";
|
|
20
|
-
import {AffiseNative} from "./native/AffiseNative";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
14
|
+
import { AffiseNative } from "./native/AffiseNative";
|
|
15
|
+
import { AffiseSettings } from "./settings/AffiseSettings";
|
|
16
|
+
import type { AffiseSettingsApi } from "./Export";
|
|
17
|
+
import {
|
|
18
|
+
AffiseDebug,
|
|
19
|
+
AffiseDebugApi,
|
|
20
|
+
} from "./debug/internal";
|
|
21
|
+
import {
|
|
22
|
+
AffiseModuleApi,
|
|
23
|
+
AffiseModule,
|
|
24
|
+
AffiseIos,
|
|
25
|
+
AffiseIosApi,
|
|
26
|
+
AffiseAndroid,
|
|
27
|
+
AffiseAndroidApi
|
|
28
|
+
} from "./module/internal";
|
|
23
29
|
|
|
24
30
|
export * from "./Export";
|
|
25
31
|
|
|
@@ -37,12 +43,12 @@ export class Affise {
|
|
|
37
43
|
* @param affiseAppId - your app id
|
|
38
44
|
* @param secretKey - your SDK secretKey
|
|
39
45
|
*/
|
|
40
|
-
static settings({affiseAppId, secretKey}: { affiseAppId: string, secretKey: string }):
|
|
41
|
-
return new AffiseSettings(affiseAppId, secretKey);
|
|
46
|
+
static settings({affiseAppId, secretKey}: { affiseAppId: string, secretKey: string }): AffiseSettingsApi {
|
|
47
|
+
return new AffiseSettings(this.native, affiseAppId, secretKey);
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
/**
|
|
45
|
-
* Use Affise.settings({affiseAppId, secretKey}).start()
|
|
51
|
+
* @deprecated Use Affise.settings({affiseAppId, secretKey}).start()
|
|
46
52
|
* @param initProperties
|
|
47
53
|
*/
|
|
48
54
|
static start(
|
|
@@ -158,7 +164,7 @@ export class Affise {
|
|
|
158
164
|
* @param callback status response
|
|
159
165
|
*/
|
|
160
166
|
static getStatus(module: AffiseModules, callback: OnKeyValueCallback) {
|
|
161
|
-
|
|
167
|
+
this.module.getStatus(module, callback);
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
/**
|
|
@@ -167,7 +173,7 @@ export class Affise {
|
|
|
167
173
|
* @param module module name
|
|
168
174
|
*/
|
|
169
175
|
static moduleStart(module: AffiseModules): Promise<boolean> {
|
|
170
|
-
return
|
|
176
|
+
return this.module.moduleStart(module);
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
/**
|
|
@@ -175,7 +181,7 @@ export class Affise {
|
|
|
175
181
|
* Get installed modules
|
|
176
182
|
*/
|
|
177
183
|
static getModulesInstalled(): Promise<AffiseModules[]> {
|
|
178
|
-
return
|
|
184
|
+
return this.module.getModulesInstalled();
|
|
179
185
|
}
|
|
180
186
|
|
|
181
187
|
/**
|
|
@@ -241,7 +247,7 @@ export class Affise {
|
|
|
241
247
|
* Get referrer on server
|
|
242
248
|
*/
|
|
243
249
|
static getReferrerOnServer(callback: ReferrerCallback) {
|
|
244
|
-
|
|
250
|
+
this.getDeferredDeeplink(callback);
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
/**
|
|
@@ -249,7 +255,7 @@ export class Affise {
|
|
|
249
255
|
* Get referrer on server value
|
|
250
256
|
*/
|
|
251
257
|
static getReferrerOnServerValue(key: ReferrerKey, callback: ReferrerCallback) {
|
|
252
|
-
|
|
258
|
+
this.getDeferredDeeplinkValue(key, callback);
|
|
253
259
|
}
|
|
254
260
|
|
|
255
261
|
/**
|
|
@@ -276,139 +282,10 @@ export class Affise {
|
|
|
276
282
|
// this.native.setEnabledMetrics(enabled);
|
|
277
283
|
// }
|
|
278
284
|
|
|
279
|
-
static android =
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
static crashApplication() {
|
|
288
|
-
Affise.native.crashApplication();
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
static ios = class {
|
|
293
|
-
/**
|
|
294
|
-
* SKAd register app
|
|
295
|
-
*/
|
|
296
|
-
static registerAppForAdNetworkAttribution(completionHandler: ErrorCallback) {
|
|
297
|
-
if (Platform.OS !== 'ios') return;
|
|
298
|
-
Affise.native.registerAppForAdNetworkAttribution(completionHandler);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* SKAd updatePostbackConversionValue
|
|
303
|
-
*/
|
|
304
|
-
static updatePostbackConversionValue(fineValue: bigint, coarseValue: CoarseValue, completionHandler: ErrorCallback) {
|
|
305
|
-
if (Platform.OS !== 'ios') return;
|
|
306
|
-
Affise.native.updatePostbackConversionValue(fineValue, coarseValue, completionHandler);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* @deprecated use Affise.getDeferredDeeplink(callback)
|
|
311
|
-
* Get referrer on server
|
|
312
|
-
*/
|
|
313
|
-
static getReferrerOnServer(callback: ReferrerCallback) {
|
|
314
|
-
Affise.native.getDeferredDeeplink(callback);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* @deprecated use Affise.getDeferredDeeplinkValue(key, callback)
|
|
319
|
-
* Get referrer on server value
|
|
320
|
-
*/
|
|
321
|
-
static getReferrerOnServerValue(key: ReferrerKey, callback: ReferrerCallback) {
|
|
322
|
-
Affise.native.getDeferredDeeplinkValue(key, callback);
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
static module = class {
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Get module status
|
|
330
|
-
* @param module module name
|
|
331
|
-
* @param callback status response
|
|
332
|
-
*/
|
|
333
|
-
static getStatus(module: AffiseModules, callback: OnKeyValueCallback) {
|
|
334
|
-
Affise.native.getStatus(module, callback);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Manual module start
|
|
339
|
-
* @param module module name
|
|
340
|
-
*/
|
|
341
|
-
static moduleStart(module: AffiseModules): Promise<boolean> {
|
|
342
|
-
return Affise.native.moduleStart(module);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Get installed modules
|
|
347
|
-
*/
|
|
348
|
-
static getModulesInstalled(): Promise<AffiseModules[]> {
|
|
349
|
-
return Affise.native.getModulesInstalled();
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Module Link url Resolve
|
|
354
|
-
* @param url url
|
|
355
|
-
* @param callback redirected url
|
|
356
|
-
*/
|
|
357
|
-
static linkResolve(url: string, callback: AffiseLinkCallback) {
|
|
358
|
-
Affise.native.linkResolve(url, callback);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Module subscription fetchProducts
|
|
363
|
-
* @param ids list of product ids
|
|
364
|
-
* @param callback result callback
|
|
365
|
-
*/
|
|
366
|
-
static fetchProducts(ids: string[], callback: AffiseResultCallback<AffiseProductsResult>) {
|
|
367
|
-
Affise.native.fetchProducts(ids, callback);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Module subscription purchase
|
|
372
|
-
* @param product product
|
|
373
|
-
* @param type product type
|
|
374
|
-
* @param callback result callback
|
|
375
|
-
*/
|
|
376
|
-
static purchase(product: AffiseProduct, type: AffiseProductType, callback: AffiseResultCallback<AffisePurchasedInfo>) {
|
|
377
|
-
Affise.native.purchase(product, type, callback);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
static debug = class {
|
|
382
|
-
/**
|
|
383
|
-
* Won't work on Production
|
|
384
|
-
*
|
|
385
|
-
* Validate credentials
|
|
386
|
-
*/
|
|
387
|
-
static validate(callback: DebugOnValidateCallback) {
|
|
388
|
-
Affise.native.validate(callback);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Won't work on Production
|
|
393
|
-
*
|
|
394
|
-
* Show request/response data
|
|
395
|
-
*/
|
|
396
|
-
static network(callback: DebugOnNetworkCallback) {
|
|
397
|
-
Affise.native.network(callback);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Debug get version of flutter library
|
|
402
|
-
*/
|
|
403
|
-
static version(): string {
|
|
404
|
-
return "1.6.34";
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Debug get version of native library Android/iOS
|
|
409
|
-
*/
|
|
410
|
-
static versionNative(): Promise<string> {
|
|
411
|
-
return Affise.native.versionNative();
|
|
412
|
-
}
|
|
413
|
-
};
|
|
285
|
+
static android: AffiseAndroidApi = new AffiseAndroid(this.native);
|
|
286
|
+
static ios: AffiseIosApi = new AffiseIos(this.native);
|
|
287
|
+
|
|
288
|
+
static module: AffiseModuleApi = new AffiseModule(this.native);
|
|
289
|
+
|
|
290
|
+
static debug: AffiseDebugApi = new AffiseDebug(this.native);
|
|
414
291
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
2
|
+
import type { AffiseModuleAppsFlyerApi } from "./AffiseModuleAppsFlyerApi";
|
|
3
|
+
|
|
4
|
+
export class AffiseAppsFlyer implements AffiseModuleAppsFlyerApi {
|
|
5
|
+
private native: AffiseNative
|
|
6
|
+
|
|
7
|
+
constructor(native: AffiseNative) {
|
|
8
|
+
this.native = native
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Send Appflyer event data to affise
|
|
13
|
+
* @param eventName event name
|
|
14
|
+
* @param eventValues event data
|
|
15
|
+
*/
|
|
16
|
+
logEvent(eventName: string, eventValues: Record<string, any>) {
|
|
17
|
+
this.native.logEvent(eventName, eventValues);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
3
|
+
import type { AffiseAndroidApi } from "./AffiseAndroidApi";
|
|
4
|
+
|
|
5
|
+
export class AffiseAndroid implements AffiseAndroidApi {
|
|
6
|
+
|
|
7
|
+
private native: AffiseNative
|
|
8
|
+
|
|
9
|
+
constructor(native: AffiseNative) {
|
|
10
|
+
this.native = native
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Erases all user data from mobile and sends [GDPREvent]
|
|
15
|
+
*/
|
|
16
|
+
forget(userData: string) {
|
|
17
|
+
if (Platform.OS !== 'android') return;
|
|
18
|
+
this.native.forget(userData);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
crashApplication() {
|
|
22
|
+
if (Platform.OS !== 'android') return;
|
|
23
|
+
this.native.crashApplication();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
3
|
+
import type { AffiseIosApi } from "./AffiseIosApi";
|
|
4
|
+
import type { ErrorCallback } from "../../callback/ErrorCallback";
|
|
5
|
+
import type { CoarseValue } from "../../skad/CoarseValue";
|
|
6
|
+
import type { ReferrerKey } from "../../referrer/ReferrerKey";
|
|
7
|
+
import type { ReferrerCallback } from "../../referrer/ReferrerCallback";
|
|
8
|
+
|
|
9
|
+
export class AffiseIos implements AffiseIosApi {
|
|
10
|
+
|
|
11
|
+
private native: AffiseNative
|
|
12
|
+
|
|
13
|
+
constructor(native: AffiseNative) {
|
|
14
|
+
this.native = native
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SKAd register app
|
|
19
|
+
*/
|
|
20
|
+
registerAppForAdNetworkAttribution(completionHandler: ErrorCallback) {
|
|
21
|
+
if (Platform.OS !== 'ios') return;
|
|
22
|
+
this.native.registerAppForAdNetworkAttribution(completionHandler);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* SKAd updatePostbackConversionValue
|
|
27
|
+
*/
|
|
28
|
+
updatePostbackConversionValue(fineValue: bigint, coarseValue: CoarseValue, completionHandler: ErrorCallback) {
|
|
29
|
+
if (Platform.OS !== 'ios') return;
|
|
30
|
+
this.native.updatePostbackConversionValue(fineValue, coarseValue, completionHandler);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated use Affise.getDeferredDeeplink(callback)
|
|
35
|
+
* Get referrer on server
|
|
36
|
+
*/
|
|
37
|
+
getReferrerOnServer(callback: ReferrerCallback) {
|
|
38
|
+
this.native.getDeferredDeeplink(callback);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated use Affise.getDeferredDeeplinkValue(key, callback)
|
|
43
|
+
* Get referrer on server value
|
|
44
|
+
*/
|
|
45
|
+
getReferrerOnServerValue(key: ReferrerKey, callback: ReferrerCallback) {
|
|
46
|
+
this.native.getDeferredDeeplinkValue(key, callback);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ErrorCallback } from "../../callback/ErrorCallback";
|
|
2
|
+
import type { CoarseValue } from "../../skad/CoarseValue";
|
|
3
|
+
import type { ReferrerKey } from "../../referrer/ReferrerKey";
|
|
4
|
+
import type { ReferrerCallback } from "../../referrer/ReferrerCallback";
|
|
5
|
+
|
|
6
|
+
export interface AffiseIosApi {
|
|
7
|
+
/**
|
|
8
|
+
* SKAd register app
|
|
9
|
+
*/
|
|
10
|
+
registerAppForAdNetworkAttribution(completionHandler: ErrorCallback): void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* SKAd updatePostbackConversionValue
|
|
14
|
+
*/
|
|
15
|
+
updatePostbackConversionValue(fineValue: bigint, coarseValue: CoarseValue, completionHandler: ErrorCallback): void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use Affise.getDeferredDeeplink(callback)
|
|
19
|
+
* Get referrer on server
|
|
20
|
+
*/
|
|
21
|
+
getReferrerOnServer(callback: ReferrerCallback): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated use Affise.getDeferredDeeplinkValue(key, callback)
|
|
25
|
+
* Get referrer on server value
|
|
26
|
+
*/
|
|
27
|
+
getReferrerOnServerValue(key: ReferrerKey, callback: ReferrerCallback): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
2
|
+
import type { AffiseModuleApi } from "./AffiseModuleApi";
|
|
3
|
+
import type { AffiseModules } from "../AffiseModules";
|
|
4
|
+
import type { OnKeyValueCallback } from "../OnKeyValueCallback";
|
|
5
|
+
import type { AffiseProduct } from "../subscription/AffiseProduct";
|
|
6
|
+
import type { AffiseProductType } from "../subscription/AffiseProductType";
|
|
7
|
+
import type { AffisePurchasedInfo } from "../subscription/AffisePurchasedInfo";
|
|
8
|
+
import type { AffiseProductsResult } from "../subscription/AffiseProductsResult";
|
|
9
|
+
import type { AffiseResultCallback } from "../subscription/AffiseResultCallback";
|
|
10
|
+
import { AffiseLink} from "../link/AffiseLink"
|
|
11
|
+
import type { AffiseModuleLinkApi} from "../link/AffiseModuleLinkApi"
|
|
12
|
+
import type { AffiseLinkCallback} from "../link/AffiseLinkCallback"
|
|
13
|
+
import { AffiseSubscription } from "../subscription/AffiseSubscription";
|
|
14
|
+
import { AffiseModuleSubscriptionApi } from "../subscription/AffiseModuleSubscriptionApi";
|
|
15
|
+
import { AffiseAppsFlyer } from "../appsflyer/AffiseAppsFlyer";
|
|
16
|
+
import type { AffiseModuleAppsFlyerApi } from "../appsflyer/AffiseModuleAppsFlyerApi";
|
|
17
|
+
|
|
18
|
+
export class AffiseModule implements AffiseModuleApi {
|
|
19
|
+
private native: AffiseNative
|
|
20
|
+
|
|
21
|
+
appsFlyer: AffiseModuleAppsFlyerApi
|
|
22
|
+
link: AffiseModuleLinkApi
|
|
23
|
+
subscription: AffiseModuleSubscriptionApi
|
|
24
|
+
|
|
25
|
+
constructor(native: AffiseNative) {
|
|
26
|
+
this.native = native
|
|
27
|
+
this.appsFlyer = new AffiseAppsFlyer(native)
|
|
28
|
+
this.link = new AffiseLink(native)
|
|
29
|
+
this.subscription = new AffiseSubscription(native)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get module status
|
|
34
|
+
* @param module module name
|
|
35
|
+
* @param callback status response
|
|
36
|
+
*/
|
|
37
|
+
getStatus(module: AffiseModules, callback: OnKeyValueCallback) {
|
|
38
|
+
this.native.getStatus(module, callback);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Manual module start
|
|
43
|
+
* @param module module name
|
|
44
|
+
*/
|
|
45
|
+
moduleStart(module: AffiseModules): Promise<boolean> {
|
|
46
|
+
return this.native.moduleStart(module);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get installed modules
|
|
51
|
+
*/
|
|
52
|
+
getModulesInstalled(): Promise<AffiseModules[]> {
|
|
53
|
+
return this.native.getModulesInstalled();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated use Affise.module.link.resolve(url, callback)
|
|
58
|
+
* Module Link url Resolve
|
|
59
|
+
* @param url url
|
|
60
|
+
* @param callback redirected url
|
|
61
|
+
*/
|
|
62
|
+
linkResolve(url: string, callback: AffiseLinkCallback) {
|
|
63
|
+
this.link.resolve(url, callback);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated use Affise.module.subscription.fetchProducts(ids, callback)
|
|
68
|
+
* Module subscription fetchProducts
|
|
69
|
+
* @param ids list of product ids
|
|
70
|
+
* @param callback result callback
|
|
71
|
+
*/
|
|
72
|
+
fetchProducts(ids: string[], callback: AffiseResultCallback<AffiseProductsResult>) {
|
|
73
|
+
this.subscription.fetchProducts(ids, callback);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated use Affise.module.subscription.purchase(product, type, callback)
|
|
78
|
+
* Module subscription purchase
|
|
79
|
+
* @param product product
|
|
80
|
+
* @param type product type
|
|
81
|
+
* @param callback result callback
|
|
82
|
+
*/
|
|
83
|
+
purchase(product: AffiseProduct, type: AffiseProductType, callback: AffiseResultCallback<AffisePurchasedInfo>) {
|
|
84
|
+
this.subscription.purchase(product, type, callback);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AffiseModules } from "../AffiseModules";
|
|
2
|
+
import type { OnKeyValueCallback } from "../OnKeyValueCallback";
|
|
3
|
+
import type { AffiseModuleLinkApi} from "../link/AffiseModuleLinkApi"
|
|
4
|
+
import type { AffiseLinkCallback} from "../link/AffiseLinkCallback"
|
|
5
|
+
import type { AffiseProduct } from "../subscription/AffiseProduct";
|
|
6
|
+
import type { AffiseModuleSubscriptionApi } from "../subscription/AffiseModuleSubscriptionApi";
|
|
7
|
+
import type { AffiseProductType } from "../subscription/AffiseProductType";
|
|
8
|
+
import type { AffisePurchasedInfo } from "../subscription/AffisePurchasedInfo";
|
|
9
|
+
import type { AffiseProductsResult } from "../subscription/AffiseProductsResult";
|
|
10
|
+
import type { AffiseResultCallback } from "../subscription/AffiseResultCallback";
|
|
11
|
+
import type { AffiseModuleAppsFlyerApi } from "../appsflyer/AffiseModuleAppsFlyerApi";
|
|
12
|
+
|
|
13
|
+
export interface AffiseModuleApi {
|
|
14
|
+
|
|
15
|
+
appsFlyer: AffiseModuleAppsFlyerApi;
|
|
16
|
+
link: AffiseModuleLinkApi;
|
|
17
|
+
subscription: AffiseModuleSubscriptionApi;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get module status
|
|
21
|
+
* @param module module name
|
|
22
|
+
* @param callback status response
|
|
23
|
+
*/
|
|
24
|
+
getStatus(module: AffiseModules, callback: OnKeyValueCallback): void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Manual module start
|
|
28
|
+
* @param module module name
|
|
29
|
+
*/
|
|
30
|
+
moduleStart(module: AffiseModules): Promise<boolean>
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get installed modules
|
|
34
|
+
*/
|
|
35
|
+
getModulesInstalled(): Promise<AffiseModules[]>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated use Affise.module.link.resolve(url, callback)
|
|
39
|
+
* Module Link url Resolve
|
|
40
|
+
* @param url url
|
|
41
|
+
* @param callback redirected url
|
|
42
|
+
*/
|
|
43
|
+
linkResolve(url: string, callback: AffiseLinkCallback): void;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated use Affise.module.subscription.fetchProducts(ids, callback)
|
|
47
|
+
* Module subscription fetchProducts
|
|
48
|
+
* @param ids list of product ids
|
|
49
|
+
* @param callback result callback
|
|
50
|
+
*/
|
|
51
|
+
fetchProducts(ids: string[], callback: AffiseResultCallback<AffiseProductsResult>): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated use Affise.module.subscription.purchase(product, type, callback)
|
|
55
|
+
* Module subscription purchase
|
|
56
|
+
* @param product product
|
|
57
|
+
* @param type product type
|
|
58
|
+
* @param callback result callback
|
|
59
|
+
*/
|
|
60
|
+
purchase(product: AffiseProduct, type: AffiseProductType, callback: AffiseResultCallback<AffisePurchasedInfo>): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./attribution/AffiseModule";
|
|
2
|
+
export * from "./attribution/AffiseModuleApi";
|
|
3
|
+
|
|
4
|
+
export * from "./attribution/AffiseIos";
|
|
5
|
+
export * from "./attribution/AffiseIosApi";
|
|
6
|
+
|
|
7
|
+
export * from "./attribution/AffiseAndroid";
|
|
8
|
+
export * from "./attribution/AffiseAndroidApi";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
2
|
+
import type { AffiseLinkCallback } from "./AffiseLinkCallback";
|
|
3
|
+
import type { AffiseModuleLinkApi } from "./AffiseModuleLinkApi";
|
|
4
|
+
|
|
5
|
+
export class AffiseLink implements AffiseModuleLinkApi {
|
|
6
|
+
private native: AffiseNative
|
|
7
|
+
|
|
8
|
+
constructor(native: AffiseNative) {
|
|
9
|
+
this.native = native
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Module Link url Resolve
|
|
14
|
+
* @param url url
|
|
15
|
+
* @param callback redirected url
|
|
16
|
+
*/
|
|
17
|
+
resolve(url: string, callback: AffiseLinkCallback): void {
|
|
18
|
+
this.native.linkResolve(url, callback);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AffiseLinkCallback } from "./AffiseLinkCallback";
|
|
2
|
+
|
|
3
|
+
export interface AffiseModuleLinkApi {
|
|
4
|
+
/**
|
|
5
|
+
* Module Link url Resolve
|
|
6
|
+
* @param url url
|
|
7
|
+
* @param callback redirected url
|
|
8
|
+
*/
|
|
9
|
+
resolve(url: string, callback: AffiseLinkCallback): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AffiseProduct } from "./AffiseProduct";
|
|
2
|
+
import type { AffiseProductType } from "./AffiseProductType";
|
|
3
|
+
import type { AffisePurchasedInfo } from "./AffisePurchasedInfo";
|
|
4
|
+
import type { AffiseProductsResult } from "./AffiseProductsResult";
|
|
5
|
+
import type { AffiseResultCallback } from "./AffiseResultCallback";
|
|
6
|
+
|
|
7
|
+
export interface AffiseModuleSubscriptionApi {
|
|
8
|
+
/**
|
|
9
|
+
* Module subscription fetchProducts
|
|
10
|
+
* @param ids list of product ids
|
|
11
|
+
* @param callback result callback
|
|
12
|
+
*/
|
|
13
|
+
fetchProducts(ids: string[], callback: AffiseResultCallback<AffiseProductsResult>): void;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Module subscription purchase
|
|
17
|
+
* @param product product
|
|
18
|
+
* @param type product type
|
|
19
|
+
* @param callback result callback
|
|
20
|
+
*/
|
|
21
|
+
purchase(product: AffiseProduct, type: AffiseProductType, callback: AffiseResultCallback<AffisePurchasedInfo>): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AffiseNative } from "../../native/AffiseNative";
|
|
2
|
+
import type { AffiseModuleSubscriptionApi } from "./AffiseModuleSubscriptionApi";
|
|
3
|
+
import type { AffiseProduct } from "./AffiseProduct";
|
|
4
|
+
import type { AffiseProductType } from "./AffiseProductType";
|
|
5
|
+
import type { AffisePurchasedInfo } from "./AffisePurchasedInfo";
|
|
6
|
+
import type { AffiseProductsResult } from "./AffiseProductsResult";
|
|
7
|
+
import type { AffiseResultCallback } from "./AffiseResultCallback";
|
|
8
|
+
|
|
9
|
+
export class AffiseSubscription implements AffiseModuleSubscriptionApi {
|
|
10
|
+
private native: AffiseNative
|
|
11
|
+
|
|
12
|
+
constructor(native: AffiseNative) {
|
|
13
|
+
this.native = native
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Module subscription fetchProducts
|
|
18
|
+
* @param ids list of product ids
|
|
19
|
+
* @param callback result callback
|
|
20
|
+
*/
|
|
21
|
+
fetchProducts(ids: string[], callback: AffiseResultCallback<AffiseProductsResult>) {
|
|
22
|
+
this.native.fetchProducts(ids, callback);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Module subscription purchase
|
|
27
|
+
* @param product product
|
|
28
|
+
* @param type product type
|
|
29
|
+
* @param callback result callback
|
|
30
|
+
*/
|
|
31
|
+
purchase(product: AffiseProduct, type: AffiseProductType, callback: AffiseResultCallback<AffisePurchasedInfo>) {
|
|
32
|
+
this.native.purchase(product, type, callback);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -46,6 +46,8 @@ export enum AffiseApiMethod {
|
|
|
46
46
|
MODULE_START = "module_start",
|
|
47
47
|
GET_MODULES_INSTALLED = "get_modules_installed",
|
|
48
48
|
GET_STATUS_CALLBACK = "get_status_callback",
|
|
49
|
+
// AppsFlyer Module
|
|
50
|
+
MODULE_APPSFLYER_LOG_EVENT = "module_appsflyer_log_event",
|
|
49
51
|
// Link Module
|
|
50
52
|
MODULE_LINK_LINK_RESOLVE_CALLBACK = "module_link_link_resolve_callback",
|
|
51
53
|
// Subscription Module
|
|
@@ -227,6 +227,15 @@ export class AffiseNative extends NativeBase {
|
|
|
227
227
|
data,
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
|
+
|
|
231
|
+
// AppsFlyer
|
|
232
|
+
logEvent(eventName: string, eventValues: Record<string, any>) {
|
|
233
|
+
const data: Record<string, any> = {
|
|
234
|
+
[DataName.EVENT_NAME]: eventName,
|
|
235
|
+
[DataName.EVENT_VALUES]: eventValues,
|
|
236
|
+
};
|
|
237
|
+
this.native(AffiseApiMethod.MODULE_APPSFLYER_LOG_EVENT, data);
|
|
238
|
+
}
|
|
230
239
|
////////////////////////////////////////
|
|
231
240
|
// modules
|
|
232
241
|
////////////////////////////////////////
|