affise-attribution-lib 1.6.33 → 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 +83 -12
- package/affise-attribution-native.podspec +1 -1
- package/android/build.gradle +1 -1
- package/lib/commonjs/AffiseInitProperties.js +4 -1
- package/lib/commonjs/AffiseInitProperties.js.map +1 -1
- package/lib/commonjs/Export.js +15 -4
- package/lib/commonjs/Export.js.map +1 -1
- 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/AffiseConfig.js +12 -0
- package/lib/commonjs/settings/AffiseConfig.js.map +1 -0
- package/lib/commonjs/settings/AffiseSettings.js +27 -5
- 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/AffiseInitProperties.js +4 -1
- package/lib/module/AffiseInitProperties.js.map +1 -1
- package/lib/module/Export.js +2 -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/AffiseConfig.js +5 -0
- package/lib/module/settings/AffiseConfig.js.map +1 -0
- package/lib/module/settings/AffiseSettings.js +29 -6
- 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/AffiseInitProperties.d.ts +4 -1
- package/lib/typescript/AffiseInitProperties.d.ts.map +1 -1
- package/lib/typescript/Export.d.ts +2 -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/AffiseConfig.d.ts +4 -0
- package/lib/typescript/settings/AffiseConfig.d.ts.map +1 -0
- package/lib/typescript/settings/AffiseSettings.d.ts +22 -9
- 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/AffiseInitProperties.ts +6 -1
- package/src/Export.ts +4 -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/AffiseConfig.ts +3 -0
- package/src/settings/AffiseSettings.ts +36 -13
- package/src/settings/AffiseSettingsApi.ts +84 -0
|
@@ -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
|
////////////////////////////////////////
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import type { AffiseNative } from "../native/AffiseNative";
|
|
1
2
|
import {
|
|
2
|
-
Affise,
|
|
3
3
|
AffiseInitProperties,
|
|
4
|
+
AffiseConfig
|
|
4
5
|
// AutoCatchingType
|
|
5
6
|
} from "../index";
|
|
6
7
|
|
|
7
8
|
import type { OnInitErrorHandler } from "./OnInitErrorHandler";
|
|
8
9
|
import type { OnInitSuccessHandler } from "./OnInitSuccessHandler";
|
|
10
|
+
import type { AffiseSettingsApi } from "./AffiseSettingsApi";
|
|
9
11
|
|
|
10
|
-
export class AffiseSettings {
|
|
12
|
+
export class AffiseSettings implements AffiseSettingsApi {
|
|
13
|
+
private native: AffiseNative
|
|
11
14
|
private readonly affiseAppId: string;
|
|
12
15
|
private readonly secretKey: string;
|
|
13
16
|
private isProduction: boolean = true;
|
|
@@ -19,6 +22,7 @@ export class AffiseSettings {
|
|
|
19
22
|
private domain?: string | null = null;
|
|
20
23
|
private onInitSuccessHandler?: OnInitSuccessHandler | null = null;
|
|
21
24
|
private onInitErrorHandler?: OnInitErrorHandler | null = null;
|
|
25
|
+
private configValues: Record<string, any> = {};
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* Affise SDK settings
|
|
@@ -26,7 +30,8 @@ export class AffiseSettings {
|
|
|
26
30
|
* @param affiseAppId - your app id
|
|
27
31
|
* @param secretKey - your SDK secretKey
|
|
28
32
|
*/
|
|
29
|
-
constructor(affiseAppId: string, secretKey: string) {
|
|
33
|
+
constructor(native: AffiseNative, affiseAppId: string, secretKey: string) {
|
|
34
|
+
this.native = native;
|
|
30
35
|
this.affiseAppId = affiseAppId;
|
|
31
36
|
this.secretKey = secretKey;
|
|
32
37
|
}
|
|
@@ -36,7 +41,7 @@ export class AffiseSettings {
|
|
|
36
41
|
*
|
|
37
42
|
* @param production
|
|
38
43
|
*/
|
|
39
|
-
setProduction(production: boolean):
|
|
44
|
+
setProduction(production: boolean): AffiseSettingsApi {
|
|
40
45
|
this.isProduction = production;
|
|
41
46
|
return this;
|
|
42
47
|
}
|
|
@@ -47,7 +52,7 @@ export class AffiseSettings {
|
|
|
47
52
|
*
|
|
48
53
|
* @param domain - server domain
|
|
49
54
|
*/
|
|
50
|
-
setDomain(domain: string):
|
|
55
|
+
setDomain(domain: string): AffiseSettingsApi {
|
|
51
56
|
this.domain = domain;
|
|
52
57
|
return this;
|
|
53
58
|
}
|
|
@@ -57,7 +62,7 @@ export class AffiseSettings {
|
|
|
57
62
|
*
|
|
58
63
|
* @param partParamName
|
|
59
64
|
*/
|
|
60
|
-
setPartParamName(partParamName: string):
|
|
65
|
+
setPartParamName(partParamName: string): AffiseSettingsApi {
|
|
61
66
|
this.partParamName = partParamName;
|
|
62
67
|
return this;
|
|
63
68
|
}
|
|
@@ -67,7 +72,7 @@ export class AffiseSettings {
|
|
|
67
72
|
*
|
|
68
73
|
* @param partParamNameToken
|
|
69
74
|
*/
|
|
70
|
-
setPartParamNameToken(partParamNameToken: string):
|
|
75
|
+
setPartParamNameToken(partParamNameToken: string): AffiseSettingsApi {
|
|
71
76
|
this.partParamNameToken = partParamNameToken;
|
|
72
77
|
return this;
|
|
73
78
|
}
|
|
@@ -77,7 +82,7 @@ export class AffiseSettings {
|
|
|
77
82
|
*
|
|
78
83
|
* @param appToken
|
|
79
84
|
*/
|
|
80
|
-
setAppToken(appToken: string):
|
|
85
|
+
setAppToken(appToken: string): AffiseSettingsApi {
|
|
81
86
|
this.appToken = appToken;
|
|
82
87
|
return this;
|
|
83
88
|
}
|
|
@@ -87,7 +92,7 @@ export class AffiseSettings {
|
|
|
87
92
|
*
|
|
88
93
|
* @param autoCatchingClickEvents
|
|
89
94
|
*/
|
|
90
|
-
// setAutoCatchingClickEvents(autoCatchingClickEvents: AutoCatchingType[]):
|
|
95
|
+
// setAutoCatchingClickEvents(autoCatchingClickEvents: AutoCatchingType[]): AffiseSettingsApi {
|
|
91
96
|
// this.autoCatchingClickEvents = autoCatchingClickEvents;
|
|
92
97
|
// return this;
|
|
93
98
|
// }
|
|
@@ -97,7 +102,7 @@ export class AffiseSettings {
|
|
|
97
102
|
*
|
|
98
103
|
* @param enable
|
|
99
104
|
*/
|
|
100
|
-
// setEnabledMetrics(enable: boolean):
|
|
105
|
+
// setEnabledMetrics(enable: boolean): AffiseSettingsApi {
|
|
101
106
|
// this.enabledMetrics = enable;
|
|
102
107
|
// return this;
|
|
103
108
|
// }
|
|
@@ -105,7 +110,7 @@ export class AffiseSettings {
|
|
|
105
110
|
/**
|
|
106
111
|
* Set OnInitSuccessHandler
|
|
107
112
|
*/
|
|
108
|
-
setOnInitSuccess(onInitSuccessHandler: OnInitSuccessHandler):
|
|
113
|
+
setOnInitSuccess(onInitSuccessHandler: OnInitSuccessHandler): AffiseSettingsApi {
|
|
109
114
|
this.onInitSuccessHandler = onInitSuccessHandler;
|
|
110
115
|
return this;
|
|
111
116
|
}
|
|
@@ -113,10 +118,27 @@ export class AffiseSettings {
|
|
|
113
118
|
/**
|
|
114
119
|
* Set OnInitErrorHandler
|
|
115
120
|
*/
|
|
116
|
-
setOnInitError(onInitErrorHandler: OnInitErrorHandler):
|
|
121
|
+
setOnInitError(onInitErrorHandler: OnInitErrorHandler): AffiseSettingsApi {
|
|
117
122
|
this.onInitErrorHandler = onInitErrorHandler;
|
|
118
123
|
return this;
|
|
119
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Set configValue
|
|
127
|
+
*/
|
|
128
|
+
setConfigValue(key: AffiseConfig, value: any): AffiseSettingsApi {
|
|
129
|
+
this.configValues[key] = value;
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Set configValue
|
|
135
|
+
*/
|
|
136
|
+
setConfigValues(values: Record<AffiseConfig, any>): AffiseSettingsApi {
|
|
137
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
138
|
+
this.configValues[key] = value;
|
|
139
|
+
})
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
120
142
|
|
|
121
143
|
private getInitProperties(): AffiseInitProperties {
|
|
122
144
|
return new AffiseInitProperties({
|
|
@@ -131,6 +153,7 @@ export class AffiseSettings {
|
|
|
131
153
|
domain: this.domain,
|
|
132
154
|
onInitSuccessHandler: this.onInitSuccessHandler,
|
|
133
155
|
onInitErrorHandler: this.onInitErrorHandler,
|
|
156
|
+
configStrings: this.configValues,
|
|
134
157
|
});
|
|
135
158
|
}
|
|
136
159
|
|
|
@@ -138,6 +161,6 @@ export class AffiseSettings {
|
|
|
138
161
|
* Starts Affise SDK
|
|
139
162
|
*/
|
|
140
163
|
start() {
|
|
141
|
-
|
|
164
|
+
this.native.init(this.getInitProperties());
|
|
142
165
|
}
|
|
143
166
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AffiseConfig
|
|
3
|
+
// AutoCatchingType
|
|
4
|
+
} from "../index";
|
|
5
|
+
|
|
6
|
+
import type { OnInitErrorHandler } from "./OnInitErrorHandler";
|
|
7
|
+
import type { OnInitSuccessHandler } from "./OnInitSuccessHandler";
|
|
8
|
+
|
|
9
|
+
export interface AffiseSettingsApi {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Set Affise SDK for SandBox / Production
|
|
13
|
+
*
|
|
14
|
+
* @param production
|
|
15
|
+
*/
|
|
16
|
+
setProduction(production: boolean): AffiseSettingsApi
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Set Affise SDK server domain
|
|
20
|
+
* Trailing slash is irrelevant
|
|
21
|
+
*
|
|
22
|
+
* @param domain - server domain
|
|
23
|
+
*/
|
|
24
|
+
setDomain(domain: string): AffiseSettingsApi
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Only for specific use case
|
|
28
|
+
*
|
|
29
|
+
* @param partParamName
|
|
30
|
+
*/
|
|
31
|
+
setPartParamName(partParamName: string): AffiseSettingsApi
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Only for specific use case
|
|
35
|
+
*
|
|
36
|
+
* @param partParamNameToken
|
|
37
|
+
*/
|
|
38
|
+
setPartParamNameToken(partParamNameToken: string): AffiseSettingsApi
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Set appToken
|
|
42
|
+
*
|
|
43
|
+
* @param appToken
|
|
44
|
+
*/
|
|
45
|
+
setAppToken(appToken: string): AffiseSettingsApi
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set list of AutoCatchingType
|
|
49
|
+
*
|
|
50
|
+
* @param autoCatchingClickEvents
|
|
51
|
+
*/
|
|
52
|
+
// setAutoCatchingClickEvents(autoCatchingClickEvents: AutoCatchingType[]): AffiseSettingsApi
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Set Metrics enable
|
|
56
|
+
*
|
|
57
|
+
* @param enable
|
|
58
|
+
*/
|
|
59
|
+
// setEnabledMetrics(enable: boolean): AffiseSettingsApi
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Set OnInitSuccessHandler
|
|
63
|
+
*/
|
|
64
|
+
setOnInitSuccess(onInitSuccessHandler: OnInitSuccessHandler): AffiseSettingsApi
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Set OnInitErrorHandler
|
|
68
|
+
*/
|
|
69
|
+
setOnInitError(onInitErrorHandler: OnInitErrorHandler): AffiseSettingsApi
|
|
70
|
+
/**
|
|
71
|
+
* Set configValue
|
|
72
|
+
*/
|
|
73
|
+
setConfigValue(key: AffiseConfig, value: any): AffiseSettingsApi
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Set configValue
|
|
77
|
+
*/
|
|
78
|
+
setConfigValues(values: Record<AffiseConfig, any>): AffiseSettingsApi
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Starts Affise SDK
|
|
82
|
+
*/
|
|
83
|
+
start(): void;
|
|
84
|
+
}
|