@adshift/react-native-plugin 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/AdShiftReactNativePlugin.podspec +20 -4
  2. package/CHANGELOG.md +30 -17
  3. package/README.md +55 -47
  4. package/android/build.gradle +2 -3
  5. package/android/consumer-rules.pro +2 -21
  6. package/android/src/main/AndroidManifest.xml +1 -1
  7. package/android/src/main/java/com/adshift/reactnativeplugin/ActivityIntents.kt +307 -0
  8. package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +83 -157
  9. package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +0 -20
  10. package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +0 -4
  11. package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +37 -5
  12. package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +0 -5
  13. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +7 -26
  14. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchLinkRecordTest.kt +420 -0
  15. package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +93 -34
  16. package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +0 -4
  17. package/ios/AdShiftReactNativePlugin.h +0 -12
  18. package/ios/AdShiftReactNativePlugin.mm +2 -14
  19. package/ios/AdShiftReactNativePluginHelper.swift +14 -73
  20. package/ios/Core/BridgeRules.swift +24 -29
  21. package/lib/commonjs/Adshift.js +78 -285
  22. package/lib/commonjs/Adshift.js.map +1 -1
  23. package/lib/commonjs/NativeAdShiftReactNativePlugin.js +2 -11
  24. package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -1
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/jest/index.js +4 -18
  27. package/lib/commonjs/jest/index.js.map +1 -1
  28. package/lib/commonjs/nativeSdkVersions.js +4 -6
  29. package/lib/commonjs/nativeSdkVersions.js.map +1 -1
  30. package/lib/commonjs/types/AdshiftAdRevenue.js +0 -24
  31. package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -1
  32. package/lib/commonjs/types/AdshiftConfig.js +3 -24
  33. package/lib/commonjs/types/AdshiftConfig.js.map +1 -1
  34. package/lib/commonjs/types/AdshiftConsent.js +9 -45
  35. package/lib/commonjs/types/AdshiftConsent.js.map +1 -1
  36. package/lib/commonjs/types/AdshiftConsentSnapshot.js +5 -24
  37. package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -1
  38. package/lib/commonjs/types/AdshiftDeepLink.js +3 -30
  39. package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -1
  40. package/lib/commonjs/types/AdshiftError.js +7 -27
  41. package/lib/commonjs/types/AdshiftError.js.map +1 -1
  42. package/lib/commonjs/types/AdshiftEventParam.js +4 -38
  43. package/lib/commonjs/types/AdshiftEventParam.js.map +1 -1
  44. package/lib/commonjs/types/AdshiftEventType.js +1 -39
  45. package/lib/commonjs/types/AdshiftEventType.js.map +1 -1
  46. package/lib/commonjs/types/AdshiftThirdPartySharing.js +7 -38
  47. package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -1
  48. package/lib/commonjs/version.js +1 -1
  49. package/lib/module/Adshift.js +78 -285
  50. package/lib/module/Adshift.js.map +1 -1
  51. package/lib/module/NativeAdShiftReactNativePlugin.js +2 -12
  52. package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
  53. package/lib/module/index.js +1 -46
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/jest/index.js +4 -18
  56. package/lib/module/jest/index.js.map +1 -1
  57. package/lib/module/nativeSdkVersions.js +4 -6
  58. package/lib/module/nativeSdkVersions.js.map +1 -1
  59. package/lib/module/types/AdshiftAdRevenue.js +0 -24
  60. package/lib/module/types/AdshiftAdRevenue.js.map +1 -1
  61. package/lib/module/types/AdshiftConfig.js +3 -24
  62. package/lib/module/types/AdshiftConfig.js.map +1 -1
  63. package/lib/module/types/AdshiftConsent.js +9 -45
  64. package/lib/module/types/AdshiftConsent.js.map +1 -1
  65. package/lib/module/types/AdshiftConsentSnapshot.js +5 -24
  66. package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -1
  67. package/lib/module/types/AdshiftDeepLink.js +3 -31
  68. package/lib/module/types/AdshiftDeepLink.js.map +1 -1
  69. package/lib/module/types/AdshiftError.js +7 -28
  70. package/lib/module/types/AdshiftError.js.map +1 -1
  71. package/lib/module/types/AdshiftEventParam.js +4 -38
  72. package/lib/module/types/AdshiftEventParam.js.map +1 -1
  73. package/lib/module/types/AdshiftEventType.js +1 -39
  74. package/lib/module/types/AdshiftEventType.js.map +1 -1
  75. package/lib/module/types/AdshiftThirdPartySharing.js +7 -38
  76. package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -1
  77. package/lib/module/version.js +1 -1
  78. package/lib/typescript/commonjs/src/Adshift.d.ts +61 -185
  79. package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +10 -36
  81. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/index.d.ts +0 -32
  83. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/jest/index.d.ts +6 -20
  85. package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +4 -6
  87. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +0 -24
  89. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +10 -37
  91. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +9 -49
  93. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +10 -28
  95. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +6 -34
  97. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +7 -26
  99. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +3 -19
  101. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts +1 -23
  103. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +7 -38
  105. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  107. package/lib/typescript/module/src/Adshift.d.ts +61 -185
  108. package/lib/typescript/module/src/Adshift.d.ts.map +1 -1
  109. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +10 -36
  110. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
  111. package/lib/typescript/module/src/index.d.ts +0 -32
  112. package/lib/typescript/module/src/index.d.ts.map +1 -1
  113. package/lib/typescript/module/src/jest/index.d.ts +6 -20
  114. package/lib/typescript/module/src/jest/index.d.ts.map +1 -1
  115. package/lib/typescript/module/src/nativeSdkVersions.d.ts +4 -6
  116. package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -1
  117. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +0 -24
  118. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -1
  119. package/lib/typescript/module/src/types/AdshiftConfig.d.ts +10 -37
  120. package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -1
  121. package/lib/typescript/module/src/types/AdshiftConsent.d.ts +9 -49
  122. package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -1
  123. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +10 -28
  124. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
  125. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +6 -34
  126. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -1
  127. package/lib/typescript/module/src/types/AdshiftError.d.ts +7 -26
  128. package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -1
  129. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +3 -19
  130. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -1
  131. package/lib/typescript/module/src/types/AdshiftEventType.d.ts +1 -23
  132. package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -1
  133. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +7 -38
  134. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
  135. package/lib/typescript/module/src/version.d.ts +1 -1
  136. package/package.json +11 -1
  137. package/src/Adshift.ts +82 -286
  138. package/src/NativeAdShiftReactNativePlugin.ts +10 -48
  139. package/src/index.tsx +1 -44
  140. package/src/jest/index.ts +6 -20
  141. package/src/nativeSdkVersions.ts +4 -6
  142. package/src/types/AdshiftAdRevenue.ts +0 -24
  143. package/src/types/AdshiftConfig.ts +11 -54
  144. package/src/types/AdshiftConsent.ts +9 -49
  145. package/src/types/AdshiftConsentSnapshot.ts +11 -38
  146. package/src/types/AdshiftDeepLink.ts +6 -34
  147. package/src/types/AdshiftError.ts +7 -26
  148. package/src/types/AdshiftEventParam.ts +4 -38
  149. package/src/types/AdshiftEventType.ts +1 -39
  150. package/src/types/AdshiftThirdPartySharing.ts +7 -38
  151. package/src/version.ts +1 -1
  152. package/vendor/ios/AdshiftSDK.files.json +30 -0
  153. package/vendor/ios/AdshiftSDK.xcframework/Info.plist +44 -0
  154. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/AdshiftSDK +0 -0
  155. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +315 -0
  156. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Info.plist +0 -0
  157. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.abi.json +18729 -0
  158. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +414 -0
  159. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  160. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftinterface +414 -0
  161. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/module.modulemap +4 -0
  162. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
  163. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/AdshiftSDK +0 -0
  164. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +626 -0
  165. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Info.plist +0 -0
  166. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +18729 -0
  167. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +414 -0
  168. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  169. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +414 -0
  170. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +18729 -0
  171. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +414 -0
  172. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  173. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +414 -0
  174. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/module.modulemap +4 -0
  175. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
  176. package/android/src/main/java/com/adshift/reactnativeplugin/RestoredIntents.kt +0 -64
@@ -1,6 +1,3 @@
1
- /**
2
- * Status of a deep link result.
3
- */
4
1
  export enum AdshiftDeepLinkStatus {
5
2
  /** A RightLink link, or a deferred deep link with a value. Navigate on this. */
6
3
  Found = 'found',
@@ -12,9 +9,6 @@ export enum AdshiftDeepLinkStatus {
12
9
  Error = 'error',
13
10
  }
14
11
 
15
- /**
16
- * How the link of a result reached the app.
17
- */
18
12
  export enum AdshiftDeepLinkSource {
19
13
  /** A Universal Link, or a link the app passed in itself. iOS. */
20
14
  UniversalLink = 'ul',
@@ -45,20 +39,9 @@ export enum AdshiftDeepLinkSource {
45
39
  }
46
40
 
47
41
  /**
48
- * Deep link delivered through `Adshift.onDeepLink()`.
49
- *
50
42
  * Navigate only on `status: 'found'`, and validate `deepLinkValue` first:
51
43
  * anyone can write a link. Any other URL comes back `notFound` with the URL
52
44
  * in `deepLink`. Treat `error` as "not yet".
53
- *
54
- * @example
55
- * ```typescript
56
- * Adshift.onDeepLink((deepLink) => {
57
- * if (deepLink.status === AdshiftDeepLinkStatus.Found) {
58
- * const productId = deepLink.params?.product_id;
59
- * }
60
- * });
61
- * ```
62
45
  */
63
46
  export interface AdshiftDeepLink {
64
47
  /**
@@ -67,7 +50,7 @@ export interface AdshiftDeepLink {
67
50
  */
68
51
  deepLink?: string;
69
52
 
70
- /** Standardized routing value (`deep_link_value`). */
53
+ /** Routing value, `deep_link_value`. */
71
54
  deepLinkValue?: string;
72
55
 
73
56
  /**
@@ -94,9 +77,8 @@ export interface AdshiftDeepLink {
94
77
  clickId?: string;
95
78
 
96
79
  /**
97
- * `false` for a deferred result matched without a clipboard token or an
98
- * advertising identifier: route the user, but do not sign them in or grant
99
- * a reward because of it.
80
+ * `false` when a deferred result is not certain to belong to this user: route
81
+ * them, but do not sign them in or grant a reward because of it.
100
82
  * @platform ios
101
83
  */
102
84
  matchGuaranteed?: boolean;
@@ -133,9 +115,7 @@ const SUB_KEYS = [
133
115
  'deepLinkSub5',
134
116
  ] as const;
135
117
 
136
- /**
137
- * Helper functions for creating `AdshiftDeepLink` objects.
138
- */
118
+ /** Builds `AdshiftDeepLink` values. */
139
119
  export const AdshiftDeepLink = {
140
120
  found(options: {
141
121
  deepLink: string;
@@ -199,11 +179,7 @@ export const AdshiftDeepLink = {
199
179
  };
200
180
  },
201
181
 
202
- /**
203
- * Creates a deep link from a native bridge object.
204
- *
205
- * @internal
206
- */
182
+ /** @internal */
207
183
  fromMap(map: Record<string, unknown>): AdshiftDeepLink {
208
184
  const params = readParams(map.params);
209
185
  const result: AdshiftDeepLink = {
@@ -270,11 +246,7 @@ function readParams(value: unknown): Record<string, string> | undefined {
270
246
  return count > 0 ? out : undefined;
271
247
  }
272
248
 
273
- /**
274
- * Converts `AdshiftDeepLink` to a plain object.
275
- *
276
- * @internal
277
- */
249
+ /** @internal */
278
250
  export function deepLinkToMap(
279
251
  deepLink: AdshiftDeepLink
280
252
  ): Record<string, unknown> {
@@ -1,7 +1,4 @@
1
- /**
2
- * Platform-neutral error codes used by every rejected promise and by
3
- * `StartResult.errorCode`.
4
- */
1
+ /** Codes of every rejected promise and of `StartResult.errorCode`. */
5
2
  export enum AdshiftErrorCode {
6
3
  /** `Adshift.initialize()` has not been called. */
7
4
  NotInitialized = 'NOT_INITIALIZED',
@@ -9,9 +6,9 @@ export enum AdshiftErrorCode {
9
6
  NotStarted = 'NOT_STARTED',
10
7
  /** The API key was rejected by the AdShift backend. */
11
8
  InvalidApiKey = 'INVALID_API_KEY',
12
- /** Tracking is disabled for this app on the AdShift side. */
9
+ /** Tracking is turned off for this device. */
13
10
  OptedOut = 'OPTED_OUT',
14
- /** The event queue is full; the call was not accepted. */
11
+ /** Too many calls are queued; this one was not accepted. */
15
12
  QueueFull = 'QUEUE_FULL',
16
13
  /** A parameter failed validation. */
17
14
  InvalidArgument = 'INVALID_ARGUMENT',
@@ -19,9 +16,6 @@ export enum AdshiftErrorCode {
19
16
  Unknown = 'UNKNOWN',
20
17
  }
21
18
 
22
- /**
23
- * Platform-specific details attached to an `AdshiftError`.
24
- */
25
19
  export interface AdshiftErrorInfo {
26
20
  /** Raw code reported by the native SDK, when available. */
27
21
  nativeCode?: number | string;
@@ -29,12 +23,7 @@ export interface AdshiftErrorInfo {
29
23
  nativeDomain?: string;
30
24
  }
31
25
 
32
- /**
33
- * Error thrown or rejected by the AdShift plugin.
34
- *
35
- * `code` is always one of `AdshiftErrorCode`; the original native code, when
36
- * there is one, is available in `userInfo.nativeCode`.
37
- */
26
+ /** `code` is always an `AdshiftErrorCode`; a native code is in `userInfo`. */
38
27
  export interface AdshiftError extends Error {
39
28
  code: AdshiftErrorCode;
40
29
  userInfo: AdshiftErrorInfo;
@@ -42,9 +31,6 @@ export interface AdshiftError extends Error {
42
31
 
43
32
  const CODES = new Set<string>(Object.values(AdshiftErrorCode));
44
33
 
45
- /**
46
- * Type guard for errors produced by the plugin.
47
- */
48
34
  export function isAdshiftError(error: unknown): error is AdshiftError {
49
35
  return (
50
36
  typeof error === 'object' &&
@@ -54,11 +40,7 @@ export function isAdshiftError(error: unknown): error is AdshiftError {
54
40
  );
55
41
  }
56
42
 
57
- /**
58
- * Builds an `AdshiftError` from a code and message.
59
- *
60
- * @internal
61
- */
43
+ /** @internal */
62
44
  export function createAdshiftError(
63
45
  code: AdshiftErrorCode,
64
46
  message: string,
@@ -72,9 +54,8 @@ export function createAdshiftError(
72
54
  }
73
55
 
74
56
  /**
75
- * Normalises a promise rejection coming from the native module into an
76
- * `AdshiftError`. Native modules reject with `{ code, message, userInfo }`.
77
- *
57
+ * Native modules reject with `{ code, message, userInfo }`; a code outside
58
+ * `AdshiftErrorCode` becomes `UNKNOWN`, kept as `nativeCode`.
78
59
  * @internal
79
60
  */
80
61
  export function toAdshiftError(error: unknown): AdshiftError {
@@ -1,24 +1,9 @@
1
1
  /**
2
- * Standard parameter names for the `values` passed to `Adshift.trackEvent()`.
3
- *
4
- * Reports aggregate these names. Any other key is kept with the event as a
5
- * custom parameter, so a misspelled or invented name is stored but never
6
- * counted — use the constants for anything a report has to add up, revenue
7
- * above all.
8
- *
9
- * @example
10
- * ```typescript
11
- * await Adshift.trackEvent(AdshiftEventType.Purchase, {
12
- * [AdshiftEventParam.Revenue]: 9.99,
13
- * [AdshiftEventParam.Currency]: 'USD',
14
- * [AdshiftEventParam.ContentId]: 'SKU123',
15
- * size: 'XL', // custom parameters are fine alongside them
16
- * });
17
- * ```
2
+ * Standard names for `trackEvent()` values. Reports add up only these; any
3
+ * other key is kept as a custom parameter and never counted, so use the
4
+ * constants for revenue above all.
18
5
  */
19
6
  export const AdshiftEventParam = {
20
- // ============ Commerce ============
21
-
22
7
  Price: 'as_price',
23
8
 
24
9
  /** The number reports read as revenue. Always pair it with `Currency`. */
@@ -43,8 +28,6 @@ export const AdshiftEventParam = {
43
28
 
44
29
  Validated: 'as_validated',
45
30
 
46
- // ============ Content ============
47
-
48
31
  ContentType: 'as_content_type',
49
32
 
50
33
  ContentId: 'as_content_id',
@@ -59,16 +42,12 @@ export const AdshiftEventParam = {
59
42
 
60
43
  SearchString: 'as_search_string',
61
44
 
62
- // ============ Ratings and reviews ============
63
-
64
45
  RatingValue: 'as_rating_value',
65
46
 
66
47
  MaxRatingValue: 'as_max_rating_value',
67
48
 
68
49
  ReviewText: 'as_review_text',
69
50
 
70
- // ============ User and progress ============
71
-
72
51
  CustomerUserId: 'as_customer_user_id',
73
52
 
74
53
  RegistrationMethod: 'as_registration_method',
@@ -85,8 +64,6 @@ export const AdshiftEventParam = {
85
64
 
86
65
  VirtualCurrencyName: 'as_virtual_currency_name',
87
66
 
88
- // ============ App and links ============
89
-
90
67
  DeepLink: 'as_deep_link',
91
68
 
92
69
  OldVersion: 'as_old_version',
@@ -97,8 +74,6 @@ export const AdshiftEventParam = {
97
74
 
98
75
  TouchObj: 'as_touch_obj',
99
76
 
100
- // ============ Dates and places ============
101
-
102
77
  DateA: 'as_date_a',
103
78
 
104
79
  DateB: 'as_date_b',
@@ -123,8 +98,6 @@ export const AdshiftEventParam = {
123
98
 
124
99
  DestinationList: 'as_destination_list',
125
100
 
126
- // ============ Travel ============
127
-
128
101
  DepartingDepartureDate: 'as_departing_departure_date',
129
102
 
130
103
  ReturningDepartureDate: 'as_returning_departure_date',
@@ -161,8 +134,6 @@ export const AdshiftEventParam = {
161
134
 
162
135
  PreferredNumStops: 'as_preferred_num_stops',
163
136
 
164
- // ============ Free-form slots ============
165
-
166
137
  Param1: 'as_param_1',
167
138
 
168
139
  Param2: 'as_param_2',
@@ -183,10 +154,8 @@ export const AdshiftEventParam = {
183
154
 
184
155
  Param10: 'as_param_10',
185
156
 
186
- // ============ Ad revenue ============
187
157
  // `logAdRevenue()` fills Revenue, Currency, AdRevenueSource and
188
- // AdRevenueNetworkName from its own arguments and drops them from
189
- // `additionalParameters`. The rest below are yours to pass.
158
+ // AdRevenueNetworkName itself and drops them from `additionalParameters`.
190
159
 
191
160
  AdRevenueSource: 'as_adrev_source',
192
161
 
@@ -208,9 +177,6 @@ export const AdshiftEventParam = {
208
177
  export type AdshiftEventParamValue =
209
178
  (typeof AdshiftEventParam)[keyof typeof AdshiftEventParam];
210
179
 
211
- /**
212
- * Returns all standard parameter names as an array.
213
- */
214
180
  export function getAllEventParams(): AdshiftEventParamValue[] {
215
181
  return Object.values(AdshiftEventParam);
216
182
  }
@@ -1,26 +1,5 @@
1
- /**
2
- * Predefined event types for AdShift SDK.
3
- *
4
- * Use these constants for consistent event naming across your app.
5
- *
6
- * Pair them with `AdshiftEventParam` for the values.
7
- *
8
- * @example
9
- * ```typescript
10
- * await Adshift.trackEvent(AdshiftEventType.AddToCart, {
11
- * [AdshiftEventParam.ContentId]: 'SKU123',
12
- * [AdshiftEventParam.Price]: 29.99,
13
- * });
14
- * ```
15
- *
16
- * You can also use custom event names as strings:
17
- * ```typescript
18
- * await Adshift.trackEvent('custom_event_name');
19
- * ```
20
- */
1
+ /** Standard event names; any other name is tracked as a custom event. */
21
2
  export const AdshiftEventType = {
22
- // ============ E-commerce Events ============
23
-
24
3
  AddToCart: 'as_add_to_cart',
25
4
 
26
5
  AddToWishList: 'as_add_to_wishlist',
@@ -37,8 +16,6 @@ export const AdshiftEventType = {
37
16
 
38
17
  Search: 'as_search',
39
18
 
40
- // ============ User Lifecycle Events ============
41
-
42
19
  CompleteRegistration: 'as_complete_registration',
43
20
 
44
21
  Login: 'as_login',
@@ -49,8 +26,6 @@ export const AdshiftEventType = {
49
26
 
50
27
  StartTrial: 'as_start_trial',
51
28
 
52
- // ============ Gaming Events ============
53
-
54
29
  LevelAchieved: 'as_level_achieved',
55
30
 
56
31
  AchievementUnlocked: 'as_achievement_unlocked',
@@ -58,8 +33,6 @@ export const AdshiftEventType = {
58
33
  /** Note the plural in the value; the key is singular for compatibility. */
59
34
  SpentCredit: 'as_spent_credits',
60
35
 
61
- // ============ Engagement Events ============
62
-
63
36
  Rate: 'as_rate',
64
37
 
65
38
  Share: 'as_share',
@@ -72,12 +45,8 @@ export const AdshiftEventType = {
72
45
 
73
46
  OpenedFromPushNotification: 'as_opened_from_push_notification',
74
47
 
75
- // ============ Travel Events ============
76
-
77
48
  TravelBooking: 'as_travel_booking',
78
49
 
79
- // ============ Ad Events ============
80
-
81
50
  AdClick: 'as_ad_click',
82
51
 
83
52
  AdView: 'as_ad_view',
@@ -85,16 +54,12 @@ export const AdshiftEventType = {
85
54
  /** Ad revenue impression. Prefer `Adshift.logAdRevenue()`. */
86
55
  AdRevenue: 'as_ad_revenue',
87
56
 
88
- // ============ Location Events ============
89
-
90
57
  /** Region or place the user moved to, as your own values. */
91
58
  LocationChanged: 'as_location_changed',
92
59
 
93
60
  /** Latitude and longitude. Send only what your privacy notice covers. */
94
61
  LocationCoordinates: 'as_location_coordinates',
95
62
 
96
- // ============ Other Events ============
97
-
98
63
  /** Your order identifier, for matching purchases with your own records. */
99
64
  OrderId: 'as_order_id',
100
65
 
@@ -105,9 +70,6 @@ export const AdshiftEventType = {
105
70
  export type AdshiftEventTypeValue =
106
71
  (typeof AdshiftEventType)[keyof typeof AdshiftEventType];
107
72
 
108
- /**
109
- * Returns all predefined event types as an array.
110
- */
111
73
  export function getAllEventTypes(): AdshiftEventTypeValue[] {
112
74
  return Object.values(AdshiftEventType);
113
75
  }
@@ -1,37 +1,14 @@
1
1
  /**
2
- * What the app says about passing this user's data on to someone else.
3
- *
4
- * A separate question from {@link AdshiftConsent}, and one with the opposite
5
- * default. Consent under GDPR must be affirmative, so a flag nobody set counts
6
- * as no consent. Here nothing said means sharing is allowed — which is why this
7
- * is not a fourth flag on the consent object: folding the two together would
8
- * make one of them wrong.
9
- *
10
- * The three states live in the calls rather than in a nullable field. Never
11
- * calling `Adshift.setThirdPartySharing()` leaves the question unanswered,
12
- * `Adshift.clearThirdPartySharing()` returns to unanswered, and the value here
13
- * is the answer itself.
14
- *
15
- * An object rather than a bare `boolean` so a field can be added later without
16
- * breaking callers.
17
- *
18
- * @example
19
- * ```typescript
20
- * // The user asked not to have their data passed on
21
- * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.optedOut());
22
- *
23
- * // The user was asked and did not opt out
24
- * Adshift.setThirdPartySharing(AdshiftThirdPartySharing.allowed());
25
- * ```
2
+ * The user's answer on passing their data on to advertising partners. Unlike
3
+ * consent, no answer means allowed. Until `Adshift.setThirdPartySharing()` is
4
+ * called, or after `clearThirdPartySharing()`, the question is unanswered.
26
5
  */
27
6
  export interface AdshiftThirdPartySharing {
28
7
  /** `true` withholds this user's data from advertising partners. */
29
8
  optOut: boolean;
30
9
  }
31
10
 
32
- /**
33
- * Helper functions for creating `AdshiftThirdPartySharing` objects.
34
- */
11
+ /** Builds `AdshiftThirdPartySharing` values. */
35
12
  export const AdshiftThirdPartySharing = {
36
13
  /** The user asked not to have their data passed on. */
37
14
  optedOut(): AdshiftThirdPartySharing {
@@ -39,23 +16,15 @@ export const AdshiftThirdPartySharing = {
39
16
  },
40
17
 
41
18
  /**
42
- * The user did not ask to be excluded.
43
- *
44
- * Only worth sending when the app has actually asked. Setting this at startup
45
- * as a default is the one mistake to avoid here: a CMP answer arriving later
46
- * cannot be undone for events already sent, and the declaration is recorded
47
- * as the app's own rather than as the absence of one.
19
+ * The user was asked and did not opt out. Not a default for startup: a later
20
+ * answer cannot correct events already sent.
48
21
  */
49
22
  allowed(): AdshiftThirdPartySharing {
50
23
  return { optOut: false };
51
24
  },
52
25
  };
53
26
 
54
- /**
55
- * Converts `AdshiftThirdPartySharing` to a plain object for the native bridge.
56
- *
57
- * @internal
58
- */
27
+ /** @internal */
59
28
  export function thirdPartySharingToMap(
60
29
  sharing: AdshiftThirdPartySharing
61
30
  ): Record<string, boolean> {
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/write-version.js from package.json. Do not edit.
2
- export const PLUGIN_VERSION = '3.0.0';
2
+ export const PLUGIN_VERSION = '3.1.0';
@@ -0,0 +1,30 @@
1
+ {
2
+ "version": "3.1.0",
3
+ "url": "https://github.com/AdShift/ios-sdk/releases/download/v3.1.0/AdshiftSDK.xcframework.zip",
4
+ "archiveSha256": "402b9e13ecd2f6d32b433b7a8c12394234ea5532787ea11032f5650b05ad837c",
5
+ "files": {
6
+ "AdshiftSDK.xcframework/Info.plist": "b24afef4deeb70179ccafb5ef8e8ae1d73e50c3978757127bc43a7f9d99c94d0",
7
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/AdshiftSDK": "5d71c5e7f78bec0334e1df518897768cccad8c2f98b1441eb31666078202e3f3",
8
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h": "6e11c70deff911037c25867bbc52c365e3c37245b9c0a0028d2637c34c89471b",
9
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Info.plist": "b55d630898f79e7b2dda56953c172fcd72eb09508f3534b2aab1b96101f10fc1",
10
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.abi.json": "6b644b4a26d8af345de60394c5c6fa442176e6f90146296a5fbbe7a9466c1fae",
11
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.private.swiftinterface": "3d9c145e6875235ddbff9752eb38afdbea050763234d6b3a3cb5f29e86bdc9d6",
12
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftdoc": "c7ab52d74e5b316790366a943e3499d56f110fe733b9776f996b3d766c7154a0",
13
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftinterface": "3d9c145e6875235ddbff9752eb38afdbea050763234d6b3a3cb5f29e86bdc9d6",
14
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/module.modulemap": "766e4ac892192f5f3914e4b1100399101de5db8482ce1906d7f67216f4537f79",
15
+ "AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/PrivacyInfo.xcprivacy": "93d1a8c42acad28f0c941fc9bb5f3671b00e59a6f30a6fa2fb9b103fe53c6367",
16
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/AdshiftSDK": "991c4ae248ba18b19c5bbea4b66a83728ae25ba48ac03ca4ce5a32b3f0aa1e41",
17
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h": "38b6a8b330897cb483b0bcbc3626bafa4bf72ee73151900d83404345b3d80ddc",
18
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Info.plist": "5e9aa1976d3caeb6780e50401417027f716b9a481f24afdb6d006ec89927e327",
19
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.abi.json": "6b644b4a26d8af345de60394c5c6fa442176e6f90146296a5fbbe7a9466c1fae",
20
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface": "55d5714d3f7e767b44c01c7c4bfadbbb061e166d8106a09c5db9a23092727ffb",
21
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc": "8fd631899680aabc9475a5dd19d6d76cb1f29362ae3d76ce3405341484180c18",
22
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface": "55d5714d3f7e767b44c01c7c4bfadbbb061e166d8106a09c5db9a23092727ffb",
23
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json": "6b644b4a26d8af345de60394c5c6fa442176e6f90146296a5fbbe7a9466c1fae",
24
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface": "5934aa853cb04410b5ce4085d2f8b9c985946c2a2cbdc1c31aa0bfbaa263dc94",
25
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc": "4f00712ff3b77eb2debe4bff285981c55ba7f2a804d03543a1b069421bdb1436",
26
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface": "5934aa853cb04410b5ce4085d2f8b9c985946c2a2cbdc1c31aa0bfbaa263dc94",
27
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/module.modulemap": "766e4ac892192f5f3914e4b1100399101de5db8482ce1906d7f67216f4537f79",
28
+ "AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/PrivacyInfo.xcprivacy": "93d1a8c42acad28f0c941fc9bb5f3671b00e59a6f30a6fa2fb9b103fe53c6367"
29
+ }
30
+ }
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>AdshiftSDK.framework/AdshiftSDK</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>ios-arm64</string>
12
+ <key>LibraryPath</key>
13
+ <string>AdshiftSDK.framework</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ </array>
18
+ <key>SupportedPlatform</key>
19
+ <string>ios</string>
20
+ </dict>
21
+ <dict>
22
+ <key>BinaryPath</key>
23
+ <string>AdshiftSDK.framework/AdshiftSDK</string>
24
+ <key>LibraryIdentifier</key>
25
+ <string>ios-arm64_x86_64-simulator</string>
26
+ <key>LibraryPath</key>
27
+ <string>AdshiftSDK.framework</string>
28
+ <key>SupportedArchitectures</key>
29
+ <array>
30
+ <string>arm64</string>
31
+ <string>x86_64</string>
32
+ </array>
33
+ <key>SupportedPlatform</key>
34
+ <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
+ </dict>
38
+ </array>
39
+ <key>CFBundlePackageType</key>
40
+ <string>XFWK</string>
41
+ <key>XCFrameworkFormatVersion</key>
42
+ <string>1.0</string>
43
+ </dict>
44
+ </plist>