@adshift/react-native-plugin 2.1.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 (185) hide show
  1. package/AdShiftReactNativePlugin.podspec +20 -4
  2. package/CHANGELOG.md +57 -8
  3. package/README.md +131 -74
  4. package/android/build.gradle +3 -2
  5. package/android/consumer-rules.pro +2 -21
  6. package/android/src/main/AndroidManifest.xml +14 -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 +90 -153
  9. package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +0 -20
  10. package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +40 -7
  11. package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +51 -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 +21 -11
  14. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchLinkRecordTest.kt +420 -0
  15. package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +97 -25
  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 +7 -14
  19. package/ios/AdShiftReactNativePluginHelper.swift +38 -73
  20. package/ios/Core/BridgeRules.swift +42 -30
  21. package/lib/commonjs/Adshift.js +100 -284
  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 +6 -0
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/jest/index.js +6 -18
  28. package/lib/commonjs/jest/index.js.map +1 -1
  29. package/lib/commonjs/nativeSdkVersions.js +4 -6
  30. package/lib/commonjs/nativeSdkVersions.js.map +1 -1
  31. package/lib/commonjs/types/AdshiftAdRevenue.js +0 -24
  32. package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -1
  33. package/lib/commonjs/types/AdshiftConfig.js +11 -23
  34. package/lib/commonjs/types/AdshiftConfig.js.map +1 -1
  35. package/lib/commonjs/types/AdshiftConsent.js +9 -45
  36. package/lib/commonjs/types/AdshiftConsent.js.map +1 -1
  37. package/lib/commonjs/types/AdshiftConsentSnapshot.js +5 -24
  38. package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -1
  39. package/lib/commonjs/types/AdshiftDeepLink.js +50 -33
  40. package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -1
  41. package/lib/commonjs/types/AdshiftError.js +7 -27
  42. package/lib/commonjs/types/AdshiftError.js.map +1 -1
  43. package/lib/commonjs/types/AdshiftEventParam.js +4 -38
  44. package/lib/commonjs/types/AdshiftEventParam.js.map +1 -1
  45. package/lib/commonjs/types/AdshiftEventType.js +1 -39
  46. package/lib/commonjs/types/AdshiftEventType.js.map +1 -1
  47. package/lib/commonjs/types/AdshiftThirdPartySharing.js +7 -38
  48. package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -1
  49. package/lib/commonjs/types/index.js +12 -0
  50. package/lib/commonjs/types/index.js.map +1 -1
  51. package/lib/commonjs/version.js +1 -1
  52. package/lib/module/Adshift.js +101 -285
  53. package/lib/module/Adshift.js.map +1 -1
  54. package/lib/module/NativeAdShiftReactNativePlugin.js +2 -12
  55. package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
  56. package/lib/module/index.js +2 -47
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/module/jest/index.js +7 -19
  59. package/lib/module/jest/index.js.map +1 -1
  60. package/lib/module/nativeSdkVersions.js +4 -6
  61. package/lib/module/nativeSdkVersions.js.map +1 -1
  62. package/lib/module/types/AdshiftAdRevenue.js +0 -24
  63. package/lib/module/types/AdshiftAdRevenue.js.map +1 -1
  64. package/lib/module/types/AdshiftConfig.js +10 -23
  65. package/lib/module/types/AdshiftConfig.js.map +1 -1
  66. package/lib/module/types/AdshiftConsent.js +9 -45
  67. package/lib/module/types/AdshiftConsent.js.map +1 -1
  68. package/lib/module/types/AdshiftConsentSnapshot.js +5 -24
  69. package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -1
  70. package/lib/module/types/AdshiftDeepLink.js +49 -32
  71. package/lib/module/types/AdshiftDeepLink.js.map +1 -1
  72. package/lib/module/types/AdshiftError.js +7 -28
  73. package/lib/module/types/AdshiftError.js.map +1 -1
  74. package/lib/module/types/AdshiftEventParam.js +4 -38
  75. package/lib/module/types/AdshiftEventParam.js.map +1 -1
  76. package/lib/module/types/AdshiftEventType.js +1 -39
  77. package/lib/module/types/AdshiftEventType.js.map +1 -1
  78. package/lib/module/types/AdshiftThirdPartySharing.js +7 -38
  79. package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -1
  80. package/lib/module/types/index.js +2 -2
  81. package/lib/module/types/index.js.map +1 -1
  82. package/lib/module/version.js +1 -1
  83. package/lib/typescript/commonjs/src/Adshift.d.ts +68 -184
  84. package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +18 -35
  86. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/index.d.ts +2 -34
  88. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/jest/index.d.ts +9 -21
  90. package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +4 -6
  92. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +0 -24
  94. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +35 -39
  96. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +9 -49
  98. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +10 -28
  100. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +55 -39
  102. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +7 -26
  104. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +3 -19
  106. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts +1 -23
  108. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +7 -38
  110. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/src/types/index.d.ts +3 -3
  112. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  114. package/lib/typescript/module/src/Adshift.d.ts +68 -184
  115. package/lib/typescript/module/src/Adshift.d.ts.map +1 -1
  116. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +18 -35
  117. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
  118. package/lib/typescript/module/src/index.d.ts +2 -34
  119. package/lib/typescript/module/src/index.d.ts.map +1 -1
  120. package/lib/typescript/module/src/jest/index.d.ts +9 -21
  121. package/lib/typescript/module/src/jest/index.d.ts.map +1 -1
  122. package/lib/typescript/module/src/nativeSdkVersions.d.ts +4 -6
  123. package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -1
  124. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +0 -24
  125. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -1
  126. package/lib/typescript/module/src/types/AdshiftConfig.d.ts +35 -39
  127. package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -1
  128. package/lib/typescript/module/src/types/AdshiftConsent.d.ts +9 -49
  129. package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -1
  130. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +10 -28
  131. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
  132. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +55 -39
  133. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -1
  134. package/lib/typescript/module/src/types/AdshiftError.d.ts +7 -26
  135. package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -1
  136. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +3 -19
  137. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -1
  138. package/lib/typescript/module/src/types/AdshiftEventType.d.ts +1 -23
  139. package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -1
  140. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +7 -38
  141. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
  142. package/lib/typescript/module/src/types/index.d.ts +3 -3
  143. package/lib/typescript/module/src/types/index.d.ts.map +1 -1
  144. package/lib/typescript/module/src/version.d.ts +1 -1
  145. package/package.json +11 -1
  146. package/src/Adshift.ts +118 -285
  147. package/src/NativeAdShiftReactNativePlugin.ts +19 -47
  148. package/src/index.tsx +7 -46
  149. package/src/jest/index.ts +11 -20
  150. package/src/nativeSdkVersions.ts +4 -6
  151. package/src/types/AdshiftAdRevenue.ts +0 -24
  152. package/src/types/AdshiftConfig.ts +48 -55
  153. package/src/types/AdshiftConsent.ts +9 -49
  154. package/src/types/AdshiftConsentSnapshot.ts +11 -38
  155. package/src/types/AdshiftDeepLink.ts +87 -39
  156. package/src/types/AdshiftError.ts +7 -26
  157. package/src/types/AdshiftEventParam.ts +4 -38
  158. package/src/types/AdshiftEventType.ts +1 -39
  159. package/src/types/AdshiftThirdPartySharing.ts +7 -38
  160. package/src/types/index.ts +9 -2
  161. package/src/version.ts +1 -1
  162. package/vendor/ios/AdshiftSDK.files.json +30 -0
  163. package/vendor/ios/AdshiftSDK.xcframework/Info.plist +44 -0
  164. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/AdshiftSDK +0 -0
  165. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +315 -0
  166. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Info.plist +0 -0
  167. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.abi.json +18729 -0
  168. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +414 -0
  169. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  170. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftinterface +414 -0
  171. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/module.modulemap +4 -0
  172. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
  173. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/AdshiftSDK +0 -0
  174. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +626 -0
  175. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Info.plist +0 -0
  176. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +18729 -0
  177. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +414 -0
  178. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  179. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +414 -0
  180. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +18729 -0
  181. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +414 -0
  182. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  183. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +414 -0
  184. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/module.modulemap +4 -0
  185. package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
@@ -11,100 +11,32 @@ var _index = require("./types/index.js");
11
11
  var _version = require("./version.js");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  /**
14
- * AdShift SDK for React Native.
15
- *
16
- * @example
17
- * ```typescript
18
- * import {
19
- * Adshift,
20
- * AdshiftEventParam,
21
- * AdshiftEventType,
22
- * } from '@adshift/react-native-plugin';
23
- *
24
- * // 1. Register the deep link listener (safe to do before initialize)
25
- * const subscription = Adshift.onDeepLink((deepLink) => {
26
- * // route on deepLink.deepLinkValue / deepLink.params
27
- * });
28
- *
29
- * // 2. Initialize
30
- * Adshift.initialize({ apiKey: 'your-api-key', isDebug: __DEV__ });
31
- *
32
- * // 3. Start
33
- * const result = await Adshift.start();
34
- *
35
- * // 4. Track
36
- * await Adshift.trackEvent(AdshiftEventType.Purchase, {
37
- * [AdshiftEventParam.Revenue]: 9.99,
38
- * [AdshiftEventParam.Currency]: 'USD',
39
- * });
40
- *
41
- * // Later: subscription.remove();
42
- * ```
43
- */
44
-
45
- // ============ Public types ============
46
-
47
- /**
48
- * Result of `Adshift.start()`.
49
- *
50
- * `success` reports whether the SDK started locally. The API key is checked
51
- * with the backend in the background: `apiKeyValidationStatus` is the verdict
52
- * at the time `start()` resolved, and `config.onError` reports
53
- * `INVALID_API_KEY` when that verdict is `invalid`. On iOS the verdict usually
54
- * arrives after `start()` resolved and is reported by the next `start()`; on
55
- * Android `start()` waits up to 5 s for it.
14
+ * `success` says whether the SDK started on the device. The API key is checked
15
+ * in the background; an `invalid` verdict is also reported through
16
+ * `config.onError` as `INVALID_API_KEY`. Android waits up to 5 s for the
17
+ * verdict; on iOS it usually arrives later and shows in a later `start()`.
56
18
  */
57
19
 
58
20
  /** How far the API key check had got when `start()` resolved. */
59
21
 
60
- /**
61
- * Parameters for `Adshift.trackPurchase()`.
62
- */
63
-
64
- /**
65
- * Subscription returned by `Adshift.onDeepLink()`.
66
- */
67
-
68
- /**
69
- * Native SDK versions bundled with this plugin release.
70
- */
71
-
72
- /**
73
- * Plugin information returned by `Adshift.getInfo()`.
74
- */
75
-
76
- // ============ Constants ============
77
-
78
22
  const DEEP_LINK_BUFFER_LIMIT = 20;
79
23
  const PENDING_CALL_LIMIT = 100;
80
24
  /** Bounds how long `start()` waits for the URL the app was opened with. */
81
25
  const INITIAL_URL_WAIT_MS = 3000;
82
26
  /** How long one URL counts as the same link, whoever passed it in first. */
83
27
  const AUTO_FORWARD_DEDUP_MS = 2000;
84
- /**
85
- * Mirrors a limit the SDK applies, so the warning below can name it. Raising it
86
- * there without raising it here makes the warning wrong, not the behaviour.
87
- */
28
+ /** For the warning only; on iOS it applies to amounts in USD, hence the check. */
88
29
  const MAX_AD_REVENUE_PER_IMPRESSION = 10;
89
30
  const MEDIATION_NETWORKS = new Set(Object.values(_index.AdshiftMediationNetwork));
90
- /**
91
- * Event names the SDK sends on its own. Sending them by hand would mix
92
- * hand-made records into install and session counts, which cannot be undone
93
- * once they are reported.
94
- */
31
+ /** Sent by the SDK itself. */
95
32
  const RESERVED_EVENT_NAMES = new Set(['app_install', 'app_open']);
96
33
 
97
- /**
98
- * Configuration received before `initialize()`. Each entry holds the latest
99
- * value for one setter, so the memory is bounded by the number of setters.
100
- */
101
-
102
- // ============ Internal state ============
34
+ /** Setters called before `initialize()`: each last value, all push paths. */
103
35
 
104
36
  let state = 'uninitialized';
105
37
  let frozenConfig = null;
106
38
  let startInFlight = null;
107
- /** Incremented per start attempt so a superseded attempt cannot touch the state. */
39
+ /** One per start attempt, so a superseded attempt cannot touch the state. */
108
40
  let startEpoch = 0;
109
41
  let nativeSubscription = null;
110
42
  const listeners = new Set();
@@ -120,9 +52,6 @@ let pendingSettings = {
120
52
  let errorHandler = null;
121
53
  /** Kept so `start()` can answer with the reason `initialize()` was refused. */
122
54
  let configError = null;
123
-
124
- // ============ Logging ============
125
-
126
55
  function devWarn(message) {
127
56
  if (typeof __DEV__ !== 'undefined' && __DEV__) {
128
57
  console.warn(`[AdShift] ${message}`);
@@ -130,12 +59,8 @@ function devWarn(message) {
130
59
  }
131
60
 
132
61
  /**
133
- * Reports a call the plugin declined to make.
134
- *
135
- * Public methods that return nothing have no channel to answer through, so
136
- * they never raise: raising would unwind a stack the caller did not choose,
137
- * and React Native treats an error escaping an event handler or a native
138
- * callback as fatal. The call is skipped and reported here instead.
62
+ * Methods that return nothing report a declined call here instead of raising:
63
+ * React Native treats an error escaping an event handler as fatal.
139
64
  */
140
65
  function reportDeclined(error) {
141
66
  devWarn(`${error.message} (${error.code})`);
@@ -146,9 +71,6 @@ function reportDeclined(error) {
146
71
  devWarn('config.onError threw; ignoring it.');
147
72
  }
148
73
  }
149
-
150
- // ============ Errors ============
151
-
152
74
  function notInitializedError() {
153
75
  return (0, _index.createAdshiftError)(_index.AdshiftErrorCode.NotInitialized, 'AdShift SDK is not initialized. Call Adshift.initialize(config) first.');
154
76
  }
@@ -171,11 +93,7 @@ function isStringArray(value) {
171
93
  return Array.isArray(value) && value.every(isNonEmptyString);
172
94
  }
173
95
 
174
- /**
175
- * Plain names a caller is likely to invent, mapped onto the standard constant
176
- * that carries the same meaning. Built from the constants so there is one list
177
- * to keep, not two.
178
- */
96
+ /** Plain names a caller is likely to use instead of a standard parameter. */
179
97
  const STANDARD_PARAM_BY_PLAIN_NAME = (() => {
180
98
  const index = new Map();
181
99
  const standard = new Set((0, _index.getAllEventParams)());
@@ -192,10 +110,7 @@ const STANDARD_PARAM_BY_PLAIN_NAME = (() => {
192
110
  })();
193
111
  const reportedPlainParamNames = new Set();
194
112
 
195
- /**
196
- * Warns once per name when a value carries a plain name instead of the
197
- * standard one. Sending it is allowed — it just stays a custom parameter.
198
- */
113
+ /** Warns once per name; the value is still sent, as a custom parameter. */
199
114
  function warnAboutPlainParamNames(values) {
200
115
  if (values === undefined) return;
201
116
  for (const key of Object.keys(values)) {
@@ -221,15 +136,9 @@ function validateEventValues(values, name) {
221
136
  }
222
137
  }
223
138
 
224
- // ============ Configuration received before initialize() ============
225
-
226
139
  /**
227
- * Folds settings received before `initialize()` into the config.
228
- *
229
- * The config wins for anything it states, because it is the later and more
230
- * explicit declaration. Push key paths are additive, so they are merged.
231
- * Settings that reach the SDK through a setter only are applied by
232
- * `applyPendingSettings()` right after the native module is initialized.
140
+ * The config wins over a value set before `initialize()`; push paths from both
141
+ * are kept. Values without a config option go through `applyPendingSettings()`.
233
142
  */
234
143
  function withPendingSettings(config) {
235
144
  const merged = {
@@ -281,9 +190,6 @@ function applyPendingSettings() {
281
190
  }
282
191
  }
283
192
  }
284
-
285
- // ============ Deep link delivery ============
286
-
287
193
  function ensureNativeSubscription() {
288
194
  if (nativeSubscription) return;
289
195
  nativeSubscription = _NativeAdShiftReactNativePlugin.default.onDeepLink(payload => {
@@ -291,9 +197,7 @@ function ensureNativeSubscription() {
291
197
  });
292
198
  }
293
199
  function dispatchDeepLink(deepLink) {
294
- // A result must never overtake one already waiting in the buffer: a deferred
295
- // link delivered after a link tapped later would attribute the install to
296
- // the wrong click.
200
+ // A result must not overtake one still waiting in the buffer.
297
201
  if (listeners.size === 0 || deepLinkBuffer.length > 0) {
298
202
  bufferDeepLink(deepLink);
299
203
  scheduleReplay();
@@ -337,9 +241,6 @@ function scheduleReplay() {
337
241
  }
338
242
  });
339
243
  }
340
-
341
- // ============ Automatic URL forwarding (iOS) ============
342
-
343
244
  function autoForwardEnabled() {
344
245
  return _reactNative.Platform.OS === 'ios' && frozenConfig !== null && frozenConfig.autoHandleDeepLinks !== false;
345
246
  }
@@ -349,16 +250,13 @@ function startLinkingAutoForward() {
349
250
  url
350
251
  }) => {
351
252
  if (state === 'uninitialized' || !autoForwardEnabled()) return;
352
- // An app that handles `url` itself and calls handleDeepLink() sees the same
353
- // event here, and the two are indistinguishable from a second tap. The
354
- // short window treats them as one link; a tap that comes later is a
355
- // separate click and is forwarded.
253
+ // An app that also passes this event to handleDeepLink() must not count the
254
+ // link twice; a tap after the short window is a new click.
356
255
  if (wasAutoForwardedRecently(url)) return;
357
256
  forwardUrl(url, false).catch(() => undefined);
358
257
  });
359
- // The launch URL is read on every initialize(), so it comes back after a
360
- // JavaScript reload as well. It is marked as such, and the native side keeps
361
- // it for the lifetime of the process, so the link is booked once.
258
+ // getInitialURL() returns the launch URL again after a JavaScript reload;
259
+ // marked as the launch URL, native forwards it once per process.
362
260
  initialUrlForward = _reactNative.Linking.getInitialURL().then(url => url ? forwardUrl(url, true) : undefined).catch(() => undefined).finally(() => {
363
261
  initialUrlForward = null;
364
262
  });
@@ -401,9 +299,6 @@ async function waitForInitialUrlForward() {
401
299
  if (timer !== undefined) clearTimeout(timer);
402
300
  }
403
301
  }
404
-
405
- // ============ Start gating ============
406
-
407
302
  function runWhenStarted(run) {
408
303
  switch (state) {
409
304
  case 'uninitialized':
@@ -444,11 +339,7 @@ function rejectPendingCalls(error) {
444
339
  }
445
340
  }
446
341
 
447
- /**
448
- * Warns when the native SDK on the device is not the one this release was built
449
- * against. Only iOS reports its version, so on Android the pin is guarded by a
450
- * build-time test instead.
451
- */
342
+ /** Only iOS reports its SDK version; on Android a build test guards the pin. */
452
343
  function checkNativeSdkVersion(reported) {
453
344
  if (typeof reported !== 'string' || reported.length === 0) return;
454
345
  const expected = _reactNative.Platform.OS === 'ios' ? _nativeSdkVersions.NATIVE_SDK_VERSIONS.ios : _reactNative.Platform.OS === 'android' ? _nativeSdkVersions.NATIVE_SDK_VERSIONS.android : null;
@@ -487,8 +378,7 @@ async function performStart() {
487
378
  await waitForInitialUrlForward();
488
379
  const result = readStartResult(await _NativeAdShiftReactNativePlugin.default.start());
489
380
  if (epoch !== startEpoch) {
490
- // A newer start() owns the lifecycle now; report what native said and
491
- // leave the state to the newer attempt.
381
+ // A newer start() owns the state now.
492
382
  return result;
493
383
  }
494
384
  if (state !== 'starting') {
@@ -507,7 +397,6 @@ async function performStart() {
507
397
  state = 'started';
508
398
  flushPendingCalls();
509
399
  if (result.apiKeyValidationStatus === 'invalid') {
510
- // The SDK started locally, but nothing it sends will be accepted.
511
400
  reportDeclined((0, _index.createAdshiftError)(_index.AdshiftErrorCode.InvalidApiKey, 'AdShift SDK: the backend rejected this API key; no data will be reported.'));
512
401
  }
513
402
  return result;
@@ -529,8 +418,6 @@ async function performStart() {
529
418
  errorCode: mapped.code,
530
419
  errorMessage: mapped.message
531
420
  };
532
- // What the platform said travels with the result, the same way it does
533
- // when the native side answers with a failure instead of rejecting.
534
421
  if (mapped.userInfo.nativeCode !== undefined) {
535
422
  result.nativeCode = mapped.userInfo.nativeCode;
536
423
  }
@@ -542,31 +429,17 @@ async function performStart() {
542
429
  }
543
430
 
544
431
  /**
545
- * Whether a failed start rules out the calls waiting for it.
546
- *
547
- * A rejected key, an excluded device and a missing configuration cannot be
548
- * fixed by trying again, so the waiting calls are answered. Anything else can
549
- * be, and holding the calls is worth more than answering them quickly: the
550
- * data survives until the app starts the SDK again.
432
+ * Failures a retry cannot fix, which reject the calls waiting for `start()`.
433
+ * After any other failure they wait for the next attempt.
551
434
  */
552
435
  function isTerminalStartFailure(code) {
553
436
  return code === _index.AdshiftErrorCode.InvalidApiKey || code === _index.AdshiftErrorCode.OptedOut || code === _index.AdshiftErrorCode.NotInitialized;
554
437
  }
555
-
556
- // ============ Main SDK API ============
557
-
558
438
  const Adshift = exports.Adshift = {
559
- // ============ Lifecycle ============
560
-
561
439
  /**
562
- * Initializes the SDK.
563
- *
564
- * Call once, as early as possible (e.g. at module scope of `App.tsx`).
565
- * The configuration is fixed on the first call; later calls are ignored.
566
- *
567
- * Never raises, because it is meant to run at module scope, where an error
568
- * would stop the bundle from evaluating. An unusable config is reported
569
- * through `config.onError` and answered by `start()`.
440
+ * Call once, as early as possible, for example at module scope. The first
441
+ * config is kept; later calls are ignored. Never raises: an unusable config
442
+ * is reported through `config.onError` and returned by `start()`.
570
443
  */
571
444
  initialize(config) {
572
445
  if (state !== 'uninitialized') {
@@ -590,6 +463,10 @@ const Adshift = exports.Adshift = {
590
463
  refuse('AdShift SDK: pushDeepLinkPaths must be an array of string arrays');
591
464
  return;
592
465
  }
466
+ if (config.deferredDeepLinkClipboard !== undefined && !_index.DEFERRED_DEEP_LINK_CLIPBOARD_MODES.has(config.deferredDeepLinkClipboard)) {
467
+ refuse("AdShift SDK: deferredDeepLinkClipboard must be 'disabled', 'prompt' or 'pasteControl'");
468
+ return;
469
+ }
593
470
  configError = null;
594
471
  frozenConfig = Object.freeze(withPendingSettings(config));
595
472
  try {
@@ -609,14 +486,9 @@ const Adshift = exports.Adshift = {
609
486
  }
610
487
  },
611
488
  /**
612
- * Starts the SDK.
613
- *
614
- * Resolves once the SDK has started locally. Never rejects; inspect
615
- * `result.success` and `result.errorCode`. Calls to `trackEvent`,
616
- * `trackPurchase` and `logAdRevenue` made before this resolves are queued
617
- * and dispatched afterwards. A start that fails with a reason retrying
618
- * cannot fix rejects them instead; any other failure keeps them waiting for
619
- * the next attempt.
489
+ * Never rejects; check `result.success`. `trackEvent`, `trackPurchase` and
490
+ * `logAdRevenue` calls made before it succeeds wait for it. A failure that
491
+ * retrying cannot fix rejects them; otherwise they wait for the next try.
620
492
  */
621
493
  start() {
622
494
  if (state === 'uninitialized') {
@@ -644,11 +516,8 @@ const Adshift = exports.Adshift = {
644
516
  return attempt;
645
517
  },
646
518
  /**
647
- * Stops the SDK. Tracking calls reject with `NOT_STARTED` until the next
648
- * successful `start()`.
649
- *
650
- * Before `initialize()` there is nothing to stop: the call is reported and
651
- * skipped.
519
+ * Tracking calls reject with `NOT_STARTED` until the next successful
520
+ * `start()`. Before `initialize()` the call is reported and skipped.
652
521
  */
653
522
  stop() {
654
523
  if (state === 'uninitialized') {
@@ -668,13 +537,9 @@ const Adshift = exports.Adshift = {
668
537
  isStarted() {
669
538
  return state === 'started';
670
539
  },
671
- // ============ Configuration ============
672
-
673
540
  /**
674
- * Sets your own user identifier. Can be called before or after `start()`.
675
- *
676
- * Called before `initialize()`, the value is kept and applied afterwards.
677
- * An empty identifier is reported and skipped; nothing is raised.
541
+ * Your own user id; may be set at any time. Before `initialize()` it is kept
542
+ * and applied afterwards. An empty id is reported and skipped.
678
543
  */
679
544
  setCustomerUserId(userId) {
680
545
  if (!isNonEmptyString(userId)) {
@@ -688,9 +553,8 @@ const Adshift = exports.Adshift = {
688
553
  _NativeAdShiftReactNativePlugin.default.setCustomerUserId(userId);
689
554
  },
690
555
  /**
691
- * Enables or disables verbose SDK logging at runtime.
692
- *
693
- * Called before `initialize()`, the value is kept and applied afterwards.
556
+ * Verbose SDK logging. Before `initialize()` the value is kept and applied
557
+ * afterwards.
694
558
  */
695
559
  setDebugEnabled(enabled) {
696
560
  if (state === 'uninitialized') {
@@ -700,10 +564,9 @@ const Adshift = exports.Adshift = {
700
564
  _NativeAdShiftReactNativePlugin.default.setDebugEnabled(enabled === true);
701
565
  },
702
566
  /**
703
- * Sets the debounce interval for automatic `app_open` events.
704
- *
705
- * Called before `initialize()`, the value is kept and applied afterwards.
706
- * A negative interval is reported and skipped; nothing is raised.
567
+ * Debounce interval for automatic `app_open` events. Before `initialize()`
568
+ * the value is kept and applied afterwards. A negative value is reported and
569
+ * skipped.
707
570
  */
708
571
  setAppOpenDebounceMs(ms) {
709
572
  if (!isFiniteNumber(ms) || ms < 0) {
@@ -717,10 +580,8 @@ const Adshift = exports.Adshift = {
717
580
  _NativeAdShiftReactNativePlugin.default.setAppOpenDebounceMs(ms);
718
581
  },
719
582
  /**
720
- * Sets branded attribution domains. Must be called before `start()`.
721
- *
722
- * Called before `initialize()`, the domains are kept and applied with the
723
- * config, so they are in place before the first link is processed.
583
+ * Your own link domains; set them before `start()`. Before `initialize()`
584
+ * they are kept and passed with the config.
724
585
  */
725
586
  setBrandedDomains(domains) {
726
587
  if (!isStringArray(domains)) {
@@ -734,9 +595,8 @@ const Adshift = exports.Adshift = {
734
595
  _NativeAdShiftReactNativePlugin.default.setBrandedDomains(domains);
735
596
  },
736
597
  /**
737
- * Sets the Meta app id used to parse Meta App Links. No-op on iOS.
738
- *
739
- * Called before `initialize()`, the value is kept and applied afterwards.
598
+ * Meta app id used to parse Meta App Links; no-op on iOS. Before
599
+ * `initialize()` the value is kept and applied afterwards.
740
600
  */
741
601
  setMetaAppId(appId) {
742
602
  if (!isNonEmptyString(appId)) {
@@ -750,11 +610,9 @@ const Adshift = exports.Adshift = {
750
610
  _NativeAdShiftReactNativePlugin.default.setMetaAppId(appId);
751
611
  },
752
612
  /**
753
- * Hands over an OAID the app obtained itself, for Android devices without
754
- * Google Play services. Set `collectOaid: false` when you supply it this
755
- * way. No-op on iOS.
756
- *
757
- * Called before `initialize()`, the value is kept and applied afterwards.
613
+ * An OAID the app obtained itself, for Android devices without Google Play
614
+ * services; set `collectOaid: false` as well. No-op on iOS. Before
615
+ * `initialize()` the value is kept and applied afterwards.
758
616
  */
759
617
  setOaidData(oaid) {
760
618
  if (!isNonEmptyString(oaid)) {
@@ -767,13 +625,9 @@ const Adshift = exports.Adshift = {
767
625
  }
768
626
  _NativeAdShiftReactNativePlugin.default.setOaidData(oaid);
769
627
  },
770
- // ============ Consent (GDPR/DMA) ============
771
-
772
628
  /**
773
- * Sets consent collected by your own UI. Use `AdshiftConsent.forGDPRUser()`
774
- * or `AdshiftConsent.forNonGDPRUser()`.
775
- *
776
- * Called before `initialize()`, the consent is kept and applied afterwards.
629
+ * Consent collected by your own UI: `AdshiftConsent.forGDPRUser()` or
630
+ * `forNonGDPRUser()`. Before `initialize()` it is kept and applied later.
777
631
  */
778
632
  setConsentData(consent) {
779
633
  if (!isPlainObject(consent) || typeof consent.isUserSubjectToGDPR !== 'boolean') {
@@ -787,10 +641,8 @@ const Adshift = exports.Adshift = {
787
641
  _NativeAdShiftReactNativePlugin.default.setConsentData((0, _index.consentToMap)(consent));
788
642
  },
789
643
  /**
790
- * Enables or disables reading IAB TCF v2.2 consent from the CMP on device.
791
- * Call before `start()`.
792
- *
793
- * Called before `initialize()`, the value is kept and applied afterwards.
644
+ * Reading IAB TCF v2.2 consent from the CMP on the device. Call before
645
+ * `start()`; before `initialize()` the value is kept and applied afterwards.
794
646
  */
795
647
  enableTCFDataCollection(enabled) {
796
648
  if (state === 'uninitialized') {
@@ -800,14 +652,9 @@ const Adshift = exports.Adshift = {
800
652
  _NativeAdShiftReactNativePlugin.default.enableTCFDataCollection(enabled === true);
801
653
  },
802
654
  /**
803
- * Enables reading an IAB GPP string written by the CMP on device, used for US
804
- * state privacy signals. Off until called with `true`.
805
- *
806
- * The GPP string rides on its own axis: it is forwarded alongside whatever
807
- * decides the GDPR axis, including a consent set through `setConsentData()`,
808
- * and it does not gate the advertising identifier on the device.
809
- *
810
- * Call before `start()`. Called before `initialize()`, the value is kept and
655
+ * Reading an IAB GPP string written by the CMP, for US state privacy
656
+ * signals; off until called with `true`. It does not gate the advertising
657
+ * id. Call before `start()`; before `initialize()` the value is kept and
811
658
  * applied afterwards.
812
659
  */
813
660
  enableGPPDataCollection(enabled) {
@@ -818,20 +665,10 @@ const Adshift = exports.Adshift = {
818
665
  _NativeAdShiftReactNativePlugin.default.enableGPPDataCollection(enabled === true);
819
666
  },
820
667
  /**
821
- * States what the app collected about passing this user's data on to
822
- * advertising partners. Use `AdshiftThirdPartySharing.optedOut()` or
823
- * `AdshiftThirdPartySharing.allowed()`.
824
- *
825
- * This is the answer to a different question than `setConsentData()`, and it
826
- * has the opposite default: nothing said here means sharing is allowed, so
827
- * only call it once the user has actually been asked. Setting `allowed()` at
828
- * startup as a default records a declaration the user never made, and events
829
- * already sent cannot be recalled when a real answer arrives.
830
- *
831
- * Nothing is gated on the device either way — this travels with the events for
832
- * the backend to act on.
833
- *
834
- * Called before `initialize()`, the answer is kept and applied afterwards.
668
+ * The user's answer on sharing their data with advertising partners:
669
+ * `AdshiftThirdPartySharing.optedOut()` or `allowed()`. Unlike consent,
670
+ * saying nothing means allowed, so call it only once the user was asked;
671
+ * events already sent are not recalled. Kept if called before `initialize()`.
835
672
  */
836
673
  setThirdPartySharing(sharing) {
837
674
  if (!isPlainObject(sharing) || typeof sharing.optOut !== 'boolean') {
@@ -845,15 +682,9 @@ const Adshift = exports.Adshift = {
845
682
  _NativeAdShiftReactNativePlugin.default.setThirdPartySharing((0, _index.thirdPartySharingToMap)(sharing));
846
683
  },
847
684
  /**
848
- * Withdraws the answer set by `setThirdPartySharing()`.
849
- *
850
- * Subsequent events state nothing on this axis, which is not the same as
851
- * stating that sharing is allowed: the first leaves the decision to your
852
- * dashboard configuration, the second is the app's own declaration and is
853
- * recorded as such.
854
- *
855
- * Called before `initialize()`, this cancels a `setThirdPartySharing()` that
856
- * was also queued.
685
+ * Withdraws `setThirdPartySharing()`: later events say nothing about sharing,
686
+ * which is not the same as `allowed()`. Before `initialize()` it cancels a
687
+ * queued `setThirdPartySharing()`.
857
688
  */
858
689
  clearThirdPartySharing() {
859
690
  if (state === 'uninitialized') {
@@ -879,21 +710,11 @@ const Adshift = exports.Adshift = {
879
710
  throw (0, _index.toAdshiftError)(error);
880
711
  }
881
712
  },
882
- // ============ Event Tracking ============
883
-
884
713
  /**
885
- * Tracks an in-app event.
886
- *
887
- * `app_install` and `app_open` are reserved: the SDK sends them itself and
888
- * passing them here rejects with `INVALID_ARGUMENT`.
889
- *
890
- * Resolves once the SDK has accepted the event. A call made between
891
- * `initialize()` and a successful `start()` waits for the start: it is sent
892
- * when the SDK starts, and rejects when the start fails for a reason
893
- * retrying cannot fix (rejected key, excluded device) or after `stop()`.
894
- * A start that failed for any other reason keeps the call waiting for the
895
- * next attempt, so `start()` belongs on every launch path.
896
- *
714
+ * `app_install` and `app_open` are reserved. A call made before a successful
715
+ * `start()` waits for it, so call `start()` on every launch path; it rejects
716
+ * after `stop()` or a start failure retrying cannot fix (rejected key,
717
+ * excluded device).
897
718
  * @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`, `NOT_STARTED`,
898
719
  * `INVALID_API_KEY`, `OPTED_OUT`, `QUEUE_FULL`, `INVALID_ARGUMENT`).
899
720
  */
@@ -912,11 +733,7 @@ const Adshift = exports.Adshift = {
912
733
  warnAboutPlainParamNames(values);
913
734
  return runWhenStarted(() => _NativeAdShiftReactNativePlugin.default.trackEvent(eventName, values ?? null));
914
735
  },
915
- /**
916
- * Tracks a purchase.
917
- *
918
- * @returns Rejects with `AdshiftError` (see `trackEvent`).
919
- */
736
+ /** Waits for `start()` and rejects like `trackEvent()`. */
920
737
  trackPurchase(params) {
921
738
  if (!isPlainObject(params)) {
922
739
  return Promise.reject(invalidArgument('AdShift SDK: params must be an object'));
@@ -942,9 +759,8 @@ const Adshift = exports.Adshift = {
942
759
  return runWhenStarted(() => _NativeAdShiftReactNativePlugin.default.trackPurchase(productId, revenue, currency, transactionId));
943
760
  },
944
761
  /**
945
- * Logs ad revenue for a single impression.
946
- *
947
- * @returns Rejects with `AdshiftError` (see `trackEvent`).
762
+ * Revenue of a single impression, not an aggregate. Waits for `start()` and
763
+ * rejects like `trackEvent()`.
948
764
  */
949
765
  logAdRevenue(params) {
950
766
  if (!isPlainObject(params)) {
@@ -974,7 +790,7 @@ const Adshift = exports.Adshift = {
974
790
  if (!isFiniteNumber(revenue) || revenue <= 0) {
975
791
  return Promise.reject(invalidArgument('AdShift SDK: revenue must be a positive number'));
976
792
  }
977
- if (revenue > MAX_AD_REVENUE_PER_IMPRESSION) {
793
+ if (revenue > MAX_AD_REVENUE_PER_IMPRESSION && (_reactNative.Platform.OS === 'android' || currency.toUpperCase() === 'USD')) {
978
794
  devWarn(`logAdRevenue: revenue above ${MAX_AD_REVENUE_PER_IMPRESSION} is not recorded. ` + 'Pass the revenue of a single impression, not an aggregate.');
979
795
  }
980
796
  if (adUnitId !== undefined && typeof adUnitId !== 'string') {
@@ -1002,11 +818,7 @@ const Adshift = exports.Adshift = {
1002
818
  }
1003
819
  return runWhenStarted(() => _NativeAdShiftReactNativePlugin.default.logAdRevenue(data));
1004
820
  },
1005
- // ============ Identity ============
1006
-
1007
- /**
1008
- * Returns the AdShift device id, or `null` before `initialize()`.
1009
- */
821
+ /** `null` before `initialize()`. */
1010
822
  async getAdShiftDeviceId() {
1011
823
  if (state === 'uninitialized') {
1012
824
  return null;
@@ -1018,15 +830,9 @@ const Adshift = exports.Adshift = {
1018
830
  throw (0, _index.toAdshiftError)(error);
1019
831
  }
1020
832
  },
1021
- // ============ Deep Links ============
1022
-
1023
833
  /**
1024
- * Passes a URL to the SDK.
1025
- *
1026
- * Not needed when `autoHandleDeepLinks` is on (the default). The result is
1027
- * delivered through `onDeepLink()`; the promise resolves once the SDK has
1028
- * finished processing the URL.
1029
- *
834
+ * Passes a URL to the SDK; not needed with `autoHandleDeepLinks` on (the
835
+ * default). The result arrives through `onDeepLink()`.
1030
836
  * @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
1031
837
  * `INVALID_ARGUMENT`).
1032
838
  */
@@ -1055,11 +861,27 @@ const Adshift = exports.Adshift = {
1055
861
  }
1056
862
  },
1057
863
  /**
1058
- * Adds a key path inside push payloads that carries an AdShift deep link.
1059
- *
1060
- * Called before `initialize()`, the path is kept and registered afterwards.
1061
- * The first path you register takes over from the top-level `as_push_link`
1062
- * the SDK reads on its own, so register that key too if you still need it.
864
+ * With `deferredDeepLinkClipboard: 'pasteControl'`, passes what the user
865
+ * pasted with `UIPasteControl`, or `null` when they skipped it. Call it on
866
+ * every way out of onboarding: the first launch's deferred deep link waits
867
+ * for it. No-op on Android.
868
+ */
869
+ handlePastedDeepLink(url) {
870
+ if (url !== null && typeof url !== 'string') {
871
+ reportDeclined(invalidArgument('AdShift SDK: url must be a string or null'));
872
+ return;
873
+ }
874
+ if (state === 'uninitialized') {
875
+ reportDeclined(notInitializedError());
876
+ return;
877
+ }
878
+ _NativeAdShiftReactNativePlugin.default.handlePastedDeepLink(isNonEmptyString(url) ? url : null);
879
+ },
880
+ /**
881
+ * A key path inside push payloads that carries an AdShift deep link. The
882
+ * first path replaces the top-level `as_push_link` the SDK reads by default,
883
+ * so add that one too if you still use it. Kept if called before
884
+ * `initialize()`.
1063
885
  */
1064
886
  addPushNotificationDeepLinkPath(path) {
1065
887
  if (!isStringArray(path) || path.length === 0) {
@@ -1073,10 +895,8 @@ const Adshift = exports.Adshift = {
1073
895
  _NativeAdShiftReactNativePlugin.default.addPushNotificationDeepLinkPath(path);
1074
896
  },
1075
897
  /**
1076
- * Passes a push notification payload to the SDK. Resolves to `true` when
1077
- * the payload carried an AdShift deep link; the result then arrives
1078
- * through `onDeepLink()`.
1079
- *
898
+ * Resolves to `true` when the payload carried an AdShift deep link; the
899
+ * result then arrives through `onDeepLink()`.
1080
900
  * @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
1081
901
  * `INVALID_ARGUMENT`).
1082
902
  */
@@ -1094,11 +914,9 @@ const Adshift = exports.Adshift = {
1094
914
  }
1095
915
  },
1096
916
  /**
1097
- * Registers a deep link listener.
1098
- *
1099
- * Safe to call before `initialize()`. Results that arrive while no
1100
- * listener is registered are buffered and delivered to the first listener.
1101
- * Every link that reaches the SDK (direct, deferred, push) is delivered.
917
+ * Safe to call before `initialize()`. Results that arrive while no listener
918
+ * is registered are buffered for the first one. Every link that reaches the
919
+ * SDK (direct, deferred, push) is delivered once.
1102
920
  */
1103
921
  onDeepLink(callback) {
1104
922
  if (typeof callback !== 'function') {
@@ -1121,8 +939,6 @@ const Adshift = exports.Adshift = {
1121
939
  }
1122
940
  };
1123
941
  },
1124
- // ============ Info ============
1125
-
1126
942
  getInfo() {
1127
943
  return {
1128
944
  platform: _reactNative.Platform.OS,