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.
Files changed (193) hide show
  1. package/README.md +83 -12
  2. package/affise-attribution-native.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/lib/commonjs/AffiseInitProperties.js +4 -1
  5. package/lib/commonjs/AffiseInitProperties.js.map +1 -1
  6. package/lib/commonjs/Export.js +15 -4
  7. package/lib/commonjs/Export.js.map +1 -1
  8. package/lib/commonjs/debug/AffiseDebug.js +49 -0
  9. package/lib/commonjs/debug/AffiseDebug.js.map +1 -0
  10. package/lib/commonjs/debug/AffiseDebugApi.js +6 -0
  11. package/lib/commonjs/debug/AffiseDebugApi.js.map +1 -0
  12. package/lib/commonjs/debug/internal.js +28 -0
  13. package/lib/commonjs/debug/internal.js.map +1 -0
  14. package/lib/commonjs/index.js +14 -138
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/module/AffiseModules.js +2 -0
  17. package/lib/commonjs/module/AffiseModules.js.map +1 -1
  18. package/lib/commonjs/module/appsflyer/AffiseAppsFlyer.js +26 -0
  19. package/lib/commonjs/module/appsflyer/AffiseAppsFlyer.js.map +1 -0
  20. package/lib/commonjs/module/appsflyer/AffiseModuleAppsFlyerApi.js +2 -0
  21. package/lib/commonjs/module/appsflyer/AffiseModuleAppsFlyerApi.js.map +1 -0
  22. package/lib/commonjs/module/attribution/AffiseAndroid.js +30 -0
  23. package/lib/commonjs/module/attribution/AffiseAndroid.js.map +1 -0
  24. package/lib/commonjs/module/attribution/AffiseAndroidApi.js +2 -0
  25. package/lib/commonjs/module/attribution/AffiseAndroidApi.js.map +1 -0
  26. package/lib/commonjs/module/attribution/AffiseIos.js +50 -0
  27. package/lib/commonjs/module/attribution/AffiseIos.js.map +1 -0
  28. package/lib/commonjs/module/attribution/AffiseIosApi.js +6 -0
  29. package/lib/commonjs/module/attribution/AffiseIosApi.js.map +1 -0
  30. package/lib/commonjs/module/attribution/AffiseModule.js +81 -0
  31. package/lib/commonjs/module/attribution/AffiseModule.js.map +1 -0
  32. package/lib/commonjs/module/attribution/AffiseModuleApi.js +6 -0
  33. package/lib/commonjs/module/attribution/AffiseModuleApi.js.map +1 -0
  34. package/lib/commonjs/module/internal.js +72 -0
  35. package/lib/commonjs/module/internal.js.map +1 -0
  36. package/lib/commonjs/module/link/AffiseLink.js +26 -0
  37. package/lib/commonjs/module/link/AffiseLink.js.map +1 -0
  38. package/lib/commonjs/module/link/AffiseModuleLinkApi.js +6 -0
  39. package/lib/commonjs/module/link/AffiseModuleLinkApi.js.map +1 -0
  40. package/lib/commonjs/module/subscription/AffiseModuleSubscriptionApi.js +6 -0
  41. package/lib/commonjs/module/subscription/AffiseModuleSubscriptionApi.js.map +1 -0
  42. package/lib/commonjs/module/subscription/AffiseSubscription.js +36 -0
  43. package/lib/commonjs/module/subscription/AffiseSubscription.js.map +1 -0
  44. package/lib/commonjs/native/AffiseApiMethod.js +1 -0
  45. package/lib/commonjs/native/AffiseApiMethod.js.map +1 -1
  46. package/lib/commonjs/native/AffiseNative.js +9 -0
  47. package/lib/commonjs/native/AffiseNative.js.map +1 -1
  48. package/lib/commonjs/native/data/DataName.js +2 -0
  49. package/lib/commonjs/native/data/DataName.js.map +1 -1
  50. package/lib/commonjs/parameters/ProviderType.js +1 -0
  51. package/lib/commonjs/parameters/ProviderType.js.map +1 -1
  52. package/lib/commonjs/settings/AffiseConfig.js +12 -0
  53. package/lib/commonjs/settings/AffiseConfig.js.map +1 -0
  54. package/lib/commonjs/settings/AffiseSettings.js +27 -5
  55. package/lib/commonjs/settings/AffiseSettings.js.map +1 -1
  56. package/lib/commonjs/settings/AffiseSettingsApi.js +6 -0
  57. package/lib/commonjs/settings/AffiseSettingsApi.js.map +1 -0
  58. package/lib/module/AffiseInitProperties.js +4 -1
  59. package/lib/module/AffiseInitProperties.js.map +1 -1
  60. package/lib/module/Export.js +2 -1
  61. package/lib/module/Export.js.map +1 -1
  62. package/lib/module/debug/AffiseDebug.js +42 -0
  63. package/lib/module/debug/AffiseDebug.js.map +1 -0
  64. package/lib/module/debug/AffiseDebugApi.js +2 -0
  65. package/lib/module/debug/AffiseDebugApi.js.map +1 -0
  66. package/lib/module/debug/internal.js +3 -0
  67. package/lib/module/debug/internal.js.map +1 -0
  68. package/lib/module/index.js +14 -139
  69. package/lib/module/index.js.map +1 -1
  70. package/lib/module/module/AffiseModules.js +2 -0
  71. package/lib/module/module/AffiseModules.js.map +1 -1
  72. package/lib/module/module/appsflyer/AffiseAppsFlyer.js +19 -0
  73. package/lib/module/module/appsflyer/AffiseAppsFlyer.js.map +1 -0
  74. package/lib/module/module/appsflyer/AffiseModuleAppsFlyerApi.js +2 -0
  75. package/lib/module/module/appsflyer/AffiseModuleAppsFlyerApi.js.map +1 -0
  76. package/lib/module/module/attribution/AffiseAndroid.js +23 -0
  77. package/lib/module/module/attribution/AffiseAndroid.js.map +1 -0
  78. package/lib/module/module/attribution/AffiseAndroidApi.js +2 -0
  79. package/lib/module/module/attribution/AffiseAndroidApi.js.map +1 -0
  80. package/lib/module/module/attribution/AffiseIos.js +43 -0
  81. package/lib/module/module/attribution/AffiseIos.js.map +1 -0
  82. package/lib/module/module/attribution/AffiseIosApi.js +2 -0
  83. package/lib/module/module/attribution/AffiseIosApi.js.map +1 -0
  84. package/lib/module/module/attribution/AffiseModule.js +74 -0
  85. package/lib/module/module/attribution/AffiseModule.js.map +1 -0
  86. package/lib/module/module/attribution/AffiseModuleApi.js +2 -0
  87. package/lib/module/module/attribution/AffiseModuleApi.js.map +1 -0
  88. package/lib/module/module/internal.js +7 -0
  89. package/lib/module/module/internal.js.map +1 -0
  90. package/lib/module/module/link/AffiseLink.js +19 -0
  91. package/lib/module/module/link/AffiseLink.js.map +1 -0
  92. package/lib/module/module/link/AffiseModuleLinkApi.js +2 -0
  93. package/lib/module/module/link/AffiseModuleLinkApi.js.map +1 -0
  94. package/lib/module/module/subscription/AffiseModuleSubscriptionApi.js +2 -0
  95. package/lib/module/module/subscription/AffiseModuleSubscriptionApi.js.map +1 -0
  96. package/lib/module/module/subscription/AffiseSubscription.js +29 -0
  97. package/lib/module/module/subscription/AffiseSubscription.js.map +1 -0
  98. package/lib/module/native/AffiseApiMethod.js +1 -0
  99. package/lib/module/native/AffiseApiMethod.js.map +1 -1
  100. package/lib/module/native/AffiseNative.js +9 -0
  101. package/lib/module/native/AffiseNative.js.map +1 -1
  102. package/lib/module/native/data/DataName.js +2 -0
  103. package/lib/module/native/data/DataName.js.map +1 -1
  104. package/lib/module/parameters/ProviderType.js +1 -0
  105. package/lib/module/parameters/ProviderType.js.map +1 -1
  106. package/lib/module/settings/AffiseConfig.js +5 -0
  107. package/lib/module/settings/AffiseConfig.js.map +1 -0
  108. package/lib/module/settings/AffiseSettings.js +29 -6
  109. package/lib/module/settings/AffiseSettings.js.map +1 -1
  110. package/lib/module/settings/AffiseSettingsApi.js +2 -0
  111. package/lib/module/settings/AffiseSettingsApi.js.map +1 -0
  112. package/lib/typescript/AffiseInitProperties.d.ts +4 -1
  113. package/lib/typescript/AffiseInitProperties.d.ts.map +1 -1
  114. package/lib/typescript/Export.d.ts +2 -1
  115. package/lib/typescript/Export.d.ts.map +1 -1
  116. package/lib/typescript/debug/AffiseDebug.d.ts +29 -0
  117. package/lib/typescript/debug/AffiseDebug.d.ts.map +1 -0
  118. package/lib/typescript/debug/AffiseDebugApi.d.ts +25 -0
  119. package/lib/typescript/debug/AffiseDebugApi.d.ts.map +1 -0
  120. package/lib/typescript/debug/internal.d.ts +3 -0
  121. package/lib/typescript/debug/internal.d.ts.map +1 -0
  122. package/lib/typescript/index.d.ts +10 -93
  123. package/lib/typescript/index.d.ts.map +1 -1
  124. package/lib/typescript/module/AffiseModules.d.ts +2 -0
  125. package/lib/typescript/module/AffiseModules.d.ts.map +1 -1
  126. package/lib/typescript/module/appsflyer/AffiseAppsFlyer.d.ts +13 -0
  127. package/lib/typescript/module/appsflyer/AffiseAppsFlyer.d.ts.map +1 -0
  128. package/lib/typescript/module/appsflyer/AffiseModuleAppsFlyerApi.d.ts +9 -0
  129. package/lib/typescript/module/appsflyer/AffiseModuleAppsFlyerApi.d.ts.map +1 -0
  130. package/lib/typescript/module/attribution/AffiseAndroid.d.ts +12 -0
  131. package/lib/typescript/module/attribution/AffiseAndroid.d.ts.map +1 -0
  132. package/lib/typescript/module/attribution/AffiseAndroidApi.d.ts +8 -0
  133. package/lib/typescript/module/attribution/AffiseAndroidApi.d.ts.map +1 -0
  134. package/lib/typescript/module/attribution/AffiseIos.d.ts +29 -0
  135. package/lib/typescript/module/attribution/AffiseIos.d.ts.map +1 -0
  136. package/lib/typescript/module/attribution/AffiseIosApi.d.ts +25 -0
  137. package/lib/typescript/module/attribution/AffiseIosApi.d.ts.map +1 -0
  138. package/lib/typescript/module/attribution/AffiseModule.d.ts +58 -0
  139. package/lib/typescript/module/attribution/AffiseModule.d.ts.map +1 -0
  140. package/lib/typescript/module/attribution/AffiseModuleApi.d.ts +54 -0
  141. package/lib/typescript/module/attribution/AffiseModuleApi.d.ts.map +1 -0
  142. package/lib/typescript/module/internal.d.ts +7 -0
  143. package/lib/typescript/module/internal.d.ts.map +1 -0
  144. package/lib/typescript/module/link/AffiseLink.d.ts +14 -0
  145. package/lib/typescript/module/link/AffiseLink.d.ts.map +1 -0
  146. package/lib/typescript/module/link/AffiseModuleLinkApi.d.ts +10 -0
  147. package/lib/typescript/module/link/AffiseModuleLinkApi.d.ts.map +1 -0
  148. package/lib/typescript/module/subscription/AffiseModuleSubscriptionApi.d.ts +21 -0
  149. package/lib/typescript/module/subscription/AffiseModuleSubscriptionApi.d.ts.map +1 -0
  150. package/lib/typescript/module/subscription/AffiseSubscription.d.ts +25 -0
  151. package/lib/typescript/module/subscription/AffiseSubscription.d.ts.map +1 -0
  152. package/lib/typescript/native/AffiseApiMethod.d.ts +1 -0
  153. package/lib/typescript/native/AffiseApiMethod.d.ts.map +1 -1
  154. package/lib/typescript/native/AffiseNative.d.ts +1 -0
  155. package/lib/typescript/native/AffiseNative.d.ts.map +1 -1
  156. package/lib/typescript/native/data/DataName.d.ts +2 -0
  157. package/lib/typescript/native/data/DataName.d.ts.map +1 -1
  158. package/lib/typescript/parameters/ProviderType.d.ts +1 -0
  159. package/lib/typescript/parameters/ProviderType.d.ts.map +1 -1
  160. package/lib/typescript/settings/AffiseConfig.d.ts +4 -0
  161. package/lib/typescript/settings/AffiseConfig.d.ts.map +1 -0
  162. package/lib/typescript/settings/AffiseSettings.d.ts +22 -9
  163. package/lib/typescript/settings/AffiseSettings.d.ts.map +1 -1
  164. package/lib/typescript/settings/AffiseSettingsApi.d.ts +67 -0
  165. package/lib/typescript/settings/AffiseSettingsApi.d.ts.map +1 -0
  166. package/package.json +1 -1
  167. package/src/AffiseInitProperties.ts +6 -1
  168. package/src/Export.ts +4 -3
  169. package/src/debug/AffiseDebug.ts +45 -0
  170. package/src/debug/AffiseDebugApi.ts +29 -0
  171. package/src/debug/internal.ts +2 -0
  172. package/src/index.ts +29 -152
  173. package/src/module/AffiseModules.ts +2 -0
  174. package/src/module/appsflyer/AffiseAppsFlyer.ts +19 -0
  175. package/src/module/appsflyer/AffiseModuleAppsFlyerApi.ts +8 -0
  176. package/src/module/attribution/AffiseAndroid.ts +25 -0
  177. package/src/module/attribution/AffiseAndroidApi.ts +8 -0
  178. package/src/module/attribution/AffiseIos.ts +48 -0
  179. package/src/module/attribution/AffiseIosApi.ts +28 -0
  180. package/src/module/attribution/AffiseModule.ts +86 -0
  181. package/src/module/attribution/AffiseModuleApi.ts +61 -0
  182. package/src/module/internal.ts +8 -0
  183. package/src/module/link/AffiseLink.ts +20 -0
  184. package/src/module/link/AffiseModuleLinkApi.ts +10 -0
  185. package/src/module/subscription/AffiseModuleSubscriptionApi.ts +22 -0
  186. package/src/module/subscription/AffiseSubscription.ts +34 -0
  187. package/src/native/AffiseApiMethod.ts +2 -0
  188. package/src/native/AffiseNative.ts +9 -0
  189. package/src/native/data/DataName.ts +3 -0
  190. package/src/parameters/ProviderType.ts +3 -0
  191. package/src/settings/AffiseConfig.ts +3 -0
  192. package/src/settings/AffiseSettings.ts +36 -13
  193. 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
  ////////////////////////////////////////
@@ -43,4 +43,7 @@ export class DataName {
43
43
  static TIME_UNIT = "timeUnit";
44
44
  static NUMBER_OF_UNITS = "numberOfUnits";
45
45
  static PRODUCT_DETAILS = "productDetails";
46
+
47
+ static EVENT_NAME = "eventName";
48
+ static EVENT_VALUES = "eventValues";
46
49
  }
@@ -91,6 +91,9 @@ export enum ProviderType {
91
91
  FIREOS_ADID = "fireos_adid",
92
92
  COLOROS_ADID = "coloros_adid",
93
93
 
94
+ // meta
95
+ META = "meta",
96
+
94
97
  // network
95
98
  MAC_SHA1 = "mac_sha1",
96
99
  MAC_MD5 = "mac_md5",
@@ -0,0 +1,3 @@
1
+ export enum AffiseConfig {
2
+ FB_APP_ID = "fb_app_id",
3
+ }
@@ -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): AffiseSettings {
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): AffiseSettings {
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): AffiseSettings {
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): AffiseSettings {
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): AffiseSettings {
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[]): AffiseSettings {
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): AffiseSettings {
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): AffiseSettings {
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): AffiseSettings {
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
- Affise.start(this.getInitProperties());
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
+ }