@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,16 @@
1
1
  require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ ios_sdk = package["adshift"]["iosSdk"]
5
+
6
+ # The SDK ships in vendor/ios, which scripts/fetch-ios-sdk.js fills before packing.
7
+ # Without it the pod cannot build, so fail here rather than with a missing-module error.
8
+ sdk_framework = "vendor/ios/AdshiftSDK.xcframework"
9
+ unless File.exist?(File.join(__dir__, sdk_framework, "Info.plist"))
10
+ message = "AdShiftReactNativePlugin: the AdShift iOS SDK #{ios_sdk["version"]} is missing " \
11
+ "from #{File.join(__dir__, "vendor", "ios")}. Install @adshift/react-native-plugin again."
12
+ raise(defined?(Pod::Informative) ? Pod::Informative.new(message) : message)
13
+ end
4
14
 
5
15
  Pod::Spec.new do |s|
6
16
  s.name = "AdShiftReactNativePlugin"
@@ -14,15 +24,21 @@ Pod::Spec.new do |s|
14
24
  s.source = { :git => "https://github.com/AdShift/react_native_plugin.git", :tag => "v#{s.version}" }
15
25
  s.swift_version = '5.9'
16
26
 
27
+ # The SDK sits outside ios/, so its headers never join the plugin's sources.
17
28
  s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
18
29
  s.private_header_files = "ios/**/*.h"
19
- # The Swift package around ios/Core exists to test the bridge rules on their
20
- # own; the app compiles those sources through this podspec instead.
30
+ # The Swift package in ios/ only tests ios/Core; the app compiles Core through this podspec.
21
31
  s.exclude_files = ["ios/Package.swift", "ios/Tests/**/*", "ios/.build/**/*"]
22
32
 
23
- # Native AdShift iOS SDK (binary xcframework; exact pin, bumped with each plugin release)
24
- s.dependency 'AdshiftSDK', '3.0.0'
33
+ s.vendored_frameworks = sdk_framework
25
34
  s.static_framework = true
35
+ s.frameworks = 'Foundation', 'UIKit', 'StoreKit', 'AdSupport', 'AppTrackingTransparency'
36
+
37
+ # A static framework brings no resources into the app, its privacy manifest included;
38
+ # the resource bundle puts the manifest where Xcode's privacy report finds it.
39
+ s.resource_bundles = {
40
+ 'AdshiftSDK' => ["#{sdk_framework}/ios-arm64/AdshiftSDK.framework/PrivacyInfo.xcprivacy"]
41
+ }
26
42
 
27
43
  s.pod_target_xcconfig = {
28
44
  'DEFINES_MODULE' => 'YES',
package/CHANGELOG.md CHANGED
@@ -9,18 +9,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  | Plugin | Android SDK | iOS SDK |
11
11
  |---|---|---|
12
+ | 3.1.0 | 4.2.0 | 3.1.0 |
12
13
  | 3.0.0 | 4.1.0 | 3.0.0 |
13
14
  | 2.1.0 | 3.2.0 | 2.4.0 |
14
15
  | 2.0.0 | 3.1.0 | 2.2.0 |
15
16
  | 1.0.0 | 2.0.3 | ~> 1.0 |
16
17
 
18
+ ## [3.1.0] - 2026-11-22
19
+
20
+ Release targeting Android SDK 4.2.0 and iOS SDK 3.1.0. Nothing in the API changes. See "Upgrading from 3.0" in the README.
21
+
22
+ ### Changed
23
+ - iOS: the AdShift iOS SDK comes inside the plugin package; `pod install` fetches nothing for it, and nothing changes in your `Podfile`, linkage mode or Expo setup. Do not add `AdshiftSDK` yourself, neither through CocoaPods nor through Swift Package Manager: if your `Podfile` has `pod 'AdshiftSDK'`, remove the line. Your own native code can still `import AdshiftSDK`.
24
+ - After `stop()` a link still reaches `onDeepLink`, but its click is not counted on either platform, and a short link arrives as tapped, without `deepLinkValue`. On Android 3.0 counted the click at the next `start()`.
25
+ - iOS: a deferred result has `deep_link_sub1`…`deep_link_sub5` in `params`, as on Android.
26
+ - The native SDKs' own changes are in the [iOS SDK](https://github.com/AdShift/ios-sdk/blob/main/CHANGELOG.md) and [Android SDK](https://github.com/AdShift/android-sdk-releases/blob/main/CHANGELOG.md) changelogs. The iOS one tells native apps to add `pod 'AdshiftSDK'`; with the plugin, do not: it carries the SDK.
27
+
28
+ ### Fixed
29
+ - Android: a link that opened the app is no longer lost when Android kills the process before `initialize()`, for example while the app waits for consent.
30
+ - Android: the same link tapped again opens and counts again after Back closed the screen it first opened.
31
+ - Android 7–9: when Android re-creates the app after killing its process, the link that opened it is not counted again, also in apps that pass `null` to `super.onCreate`.
32
+ - Android, with `autoHandleDeepLinks: false`: the launch link the app passes in again after Android re-created the app is not counted again.
33
+
17
34
  ## [3.0.0] - 2026-11-12
18
35
 
19
36
  Breaking release targeting Android SDK 4.1.0 and iOS SDK 3.0.0: RightLink deep linking. Nothing in the API was removed or renamed; most changes are in what `onDeepLink` delivers, without a build error. See "Upgrading from 2.x" in the README.
20
37
 
21
38
  ### Added
22
39
  - `AdshiftDeepLink.source` (`AdshiftDeepLinkSource`) and `clickId`: how the link reached the app and the click the open was attributed to. `isFirstSession` is now reported on iOS too.
23
- - iOS: `AdshiftDeepLink.matchGuaranteed`. It is `false` for a deferred result matched without a clipboard token or an advertising identifier: route the user, but do not sign them in or grant a reward because of it.
40
+ - iOS: `AdshiftDeepLink.matchGuaranteed`. It is `false` when a deferred result is not certain to belong to this user: route them, but do not sign them in or grant a reward because of it.
24
41
  - `AdshiftConfig.testMode`: marks every click and event as test traffic, which is kept out of reports, postbacks and billing.
25
42
  - iOS: deferred deep link from the clipboard, for RightLink templates with the clipboard option — `AdshiftConfig.deferredDeepLinkClipboard` (`'disabled'` by default, `'prompt'`, `'pasteControl'`) and `Adshift.handlePastedDeepLink(url)`.
26
43
  - RightLink links inside your app's scheme: `yourapp://rightlink?as_rl=<the link, percent-encoded>` is read as the link it wraps.
@@ -29,22 +46,18 @@ Breaking release targeting Android SDK 4.1.0 and iOS SDK 3.0.0: RightLink deep l
29
46
 
30
47
  ### Changed
31
48
  - **Navigate only on `found`.** `found` now means a RightLink link — your `*.rightlink.me` host or a domain in `brandedDomains` — or a deferred deep link with a value. Any other URL, your app's own scheme included, comes back `notFound` with the URL in `deepLink`, no `params` and no click. 2.x answered `found` for every URL.
32
- - A short link that cannot be resolved yet comes as `error`. The SDK tries again for an hour after the tap and delivers `found` when the link resolves; a deleted link is `notFound`. The tap is counted when it happens, also without a network.
49
+ - A short link that cannot be resolved yet comes as `error`, and `found` follows once it resolves; a deleted link is `notFound`.
33
50
  - The deferred deep link answers within 5 seconds of `start()`: the link, `notFound` or `error`.
34
51
  - iOS: a deferred result has no `deepLink`; its link is in `deepLinkValue` and `deepLinkSub1`…`deepLinkSub5`.
35
- - The same link handed over twice counts once, for example a notification tapped twice.
36
- - Only attribution parameters of a link leave the device: `pid`, `c` or `campaign`, `is_retargeting`, `as_*`, `utm_*`, `deep_link_value`, `deep_link_sub1`…`5` and click ids. Any other key stays in `params` for your app.
37
- - An open by a link is one `app_open` that carries the link's click.
52
+ - Only attribution parameters of a link leave the device. Any other key stays in `params` for your app.
38
53
  - After `stop()` links still reach `onDeepLink`; nothing is sent.
39
- - Android: `initialize()` makes no network call. The API key is checked at the first `start()`, and a link's click is sent after it with the consent of that moment.
40
- - Android: every RightLink link counts as a click, also without `pid` and `c`.
41
- - iOS: the 10 USD cap on the ad revenue of one impression applies after currency conversion, so a small amount in a currency with many units per dollar now counts. Android still compares the amount as given.
54
+ - Android: `initialize()` makes no network call; the API key is checked at the first `start()`.
55
+ - iOS: the 10 USD limit on the ad revenue of one impression applies to the amount in USD, so a small amount in a currency with many units per dollar is now recorded. On Android the limit is still 10 in the currency you pass.
42
56
  - iOS: SKAN revenue comes from `AdshiftEventParam.Revenue` with `AdshiftEventParam.Currency`, else from plain `revenue` with `currency`, never from `value`.
43
57
  - iOS: the SDK's privacy manifest now also declares Coarse Location and Other Diagnostic Data.
44
58
  - Android: the native SDK no longer brings AppCompat and Material into your app, and no longer needs Huawei's `ads-installreferrer`.
45
59
 
46
60
  ### Fixed
47
- - iOS: a link passed after `start()` goes on the open's `app_open`.
48
61
  - Android: `isFirstSession` is correct for a link handed over before `start()`.
49
62
  - The development warning about ad revenue above 10 no longer fires on iOS for an amount in another currency.
50
63
  - See the native changelogs for the full list.
@@ -60,7 +73,7 @@ Native SDK update targeting Android SDK 3.2.0 and iOS SDK 2.4.0. No plugin API c
60
73
  - Android: excluding `play-services-ads-identifier` no longer breaks the build; to stop collecting the advertising id, remove the `AD_ID` permission instead.
61
74
 
62
75
  ### Fixed
63
- - Events no longer reach AdShift before the install on a first launch, and on iOS an event tracked right after `start()` is no longer lost. See the native changelogs for the full list.
76
+ - iOS: an event tracked right after `start()` is no longer lost. See the native changelogs for the full list.
64
77
  - README: the Apple postback endpoint is `https://adshift.com`; `adshift-skadnetwork.com` was never a valid host. The iOS setup now also lists the two AdAttributionKit keys.
65
78
  - Docs: when `INVALID_API_KEY` is reported. `onError` fires when `start()` returns `apiKeyValidationStatus: 'invalid'`; on iOS the verdict usually arrives after `start()` resolved and is reported by the next `start()`, on Android `start()` waits up to 5 s for it.
66
79
 
@@ -76,13 +89,13 @@ Breaking release targeting Android SDK 3.1.0 and iOS SDK 2.2.0. See "Upgrading f
76
89
  - Push notification deep links: `Adshift.handlePushNotification(payload)`, `Adshift.addPushNotificationDeepLinkPath(path)`, `AdshiftConfig.pushDeepLinkPaths`.
77
90
  - Automatic deep link forwarding (`AdshiftConfig.autoHandleDeepLinks`, default `true`): launch Intent and new Intents on Android, `Linking` on iOS.
78
91
  - `AdshiftConfig.brandedDomains`, `AdshiftConfig.metaAppId`.
79
- - A release build with `minifyEnabled true` on Android needs no keep rules of your own: the native SDK ships the ones its JSON layer requires, and they arrive with the dependency. Those rules keep its public API and the models that go on the wire and leave the rest to R8, so SDK frames in your crash reports arrive obfuscated — upload the `mapping.txt` your release build produces, which Crashlytics and the Play Console do for you once configured. Do not add `-keep class com.adshift.sdk.** { *; }`: it is not needed and it forces the whole native SDK into your APK unshrunk.
92
+ - A release build with `minifyEnabled true` on Android needs no keep rules of your own; they arrive with the dependency. SDK frames in your crash reports arrive obfuscated — upload the `mapping.txt` your release build produces, which Crashlytics and the Play Console do for you once configured. Do not add `-keep class com.adshift.sdk.** { *; }`: it is not needed and it forces the whole native SDK into your APK unshrunk.
80
93
  - Typed errors: `AdshiftError`, `AdshiftErrorCode`, `isAdshiftError`; native codes in `userInfo.nativeCode` / `userInfo.nativeDomain`.
81
94
  - `ConsentSnapshot` returned by `refreshConsent()`; `ConsentFlag` tri-state consent.
82
- - `Adshift.enableGPPDataCollection(enabled)`, forwarding the IAB GPP string a CMP wrote for US state privacy. Its own axis: it rides alongside whatever decides the GDPR axis and does not gate the advertising identifier.
83
- - `Adshift.setThirdPartySharing(sharing)` and `Adshift.clearThirdPartySharing()` with `AdshiftThirdPartySharing.optedOut()` / `.allowed()`, for an answer the app collected on its own screen. Absent means sharing is allowed, so this axis reads a missing answer the opposite way to consent, and clearing is not the same as allowing.
84
- - `ConsentSnapshot.source` reports the GPP axis as `gpp` on both platforms. Android names it `GPP_US_NAT` natively, but that is one section of the framework, so a CMP writing a state section instead would make the name wrong; which section was read is a separate fact.
85
- - `ConsentSnapshot.cmpDetected`, which tells a CMP that has not been answered from no CMP at all — states every other field reports identically and which are fixed by opposite actions.
95
+ - `Adshift.enableGPPDataCollection(enabled)`, reading the IAB GPP string a CMP wrote for US state privacy. It does not gate the advertising identifier.
96
+ - `Adshift.setThirdPartySharing(sharing)` and `Adshift.clearThirdPartySharing()` with `AdshiftThirdPartySharing.optedOut()` / `.allowed()`, for an answer the app collected on its own screen. Unlike consent, no answer means sharing is allowed, and clearing is not the same as allowing.
97
+ - `ConsentSnapshot.source` reports GPP as `gpp` on both platforms.
98
+ - `ConsentSnapshot.cmpDetected`, which tells a CMP that has not been answered yet from no CMP at all.
86
99
  - `AdshiftDeepLink.isFirstSession`, `AdshiftDeepLink.params` typed as `Record<string, string>`.
87
100
  - `AdshiftEventParam` with the 81 standard parameter names reports aggregate, `getAllEventParams()` and the `AdshiftEventParamValue` type. In development, `trackEvent` and the extra parameters of `logAdRevenue` warn once per name when a value carries the plain spelling of a standard name (`price`, `contentId`) instead of the constant. Values are always sent exactly as given.
88
101
  - `PLUGIN_VERSION` and `Adshift.getInfo().nativeSdkVersions`.
@@ -102,7 +115,7 @@ Breaking release targeting Android SDK 3.1.0 and iOS SDK 2.2.0. See "Upgrading f
102
115
  - The URL that opened the app is forwarded once per process, so reloading JavaScript no longer books the same link again. A second tap on the same link is still forwarded.
103
116
  - `trackEvent` rejects `app_install` and `app_open` with `INVALID_ARGUMENT`: the SDK sends them itself.
104
117
  - Calls waiting for `start()` reject when the start failed for a reason retrying cannot fix (rejected key, excluded device, SDK not initialized). Any other failure keeps them waiting for the next attempt.
105
- - `AdshiftConsent.forGDPRUser()` accepts partial input; undecided flags are `null` and are not sent. `forNonGDPRUser()` sends no individual flags. `isConsentGranted` requires explicit `true`.
118
+ - `AdshiftConsent.forGDPRUser()` accepts partial input; undecided flags are `null`. `isConsentGranted` requires explicit `true`.
106
119
  - Errors after `stop()` use `NOT_STARTED`; backend rejections use `INVALID_API_KEY` and `OPTED_OUT`.
107
120
  - Minimum iOS 15.1 and Xcode 16.1; minimum Android API 24. React Native 0.82+ (New Architecture only).
108
121
  - Public API is limited to `src/index.tsx`; internal helpers are no longer exported.
@@ -120,7 +133,7 @@ Breaking release targeting Android SDK 3.1.0 and iOS SDK 2.2.0. See "Upgrading f
120
133
  - A deferred deep link on iOS is delivered as `status: 'found'` with `isDeferred: true`, matching Android.
121
134
  - `start()` reports `apiKeyValidationStatus` on Android too, instead of always `pending`.
122
135
  - A tracking call on a device excluded from tracking rejects with `OPTED_OUT` on iOS, matching Android.
123
- - `ConsentSnapshot.hasConsent` is replaced by `adIdentifiersAllowed`, which each platform derives with the rule it applies to the consent flags.
136
+ - `ConsentSnapshot.hasConsent` is replaced by `adIdentifiersAllowed`, which answers whether consent lets the SDK use the advertising identifier.
124
137
  - A failed `start()` carries `nativeCode` (and `nativeDomain` on iOS) for support requests, whether the native side answered with a failure or rejected.
125
138
  - The Jest mock reports the platform the test runs on and the native SDK versions the plugin is pinned to, instead of a fixed pair of values.
126
139
  - `__reset()` on the Jest mock also drops recorded calls and per-test behaviour, so state no longer leaks between tests.
package/README.md CHANGED
@@ -27,6 +27,7 @@ Official AdShift SDK for React Native. The plugin wraps the native [iOS SDK](htt
27
27
  - [Expo](#expo)
28
28
  - [Testing](#testing)
29
29
  - [Development Notes](#development-notes)
30
+ - [Upgrading from 3.0](#upgrading-from-30)
30
31
  - [Upgrading from 2.x](#upgrading-from-2x)
31
32
  - [Upgrading from 1.x](#upgrading-from-1x)
32
33
  - [Example App](#example-app)
@@ -53,6 +54,7 @@ Each plugin release pins exact native SDK versions. Do not override them in your
53
54
 
54
55
  | Plugin | Android SDK | iOS SDK |
55
56
  |---|---|---|
57
+ | 3.1.x | `com.adshift:android-sdk:4.2.0` | `AdshiftSDK 3.1.0` |
56
58
  | 3.0.x | `com.adshift:android-sdk:4.1.0` | `AdshiftSDK 3.0.0` |
57
59
  | 2.1.x | `com.adshift:android-sdk:3.2.0` | `AdshiftSDK 2.4.0` |
58
60
  | 2.0.x | `com.adshift:android-sdk:3.1.0` | `AdshiftSDK 2.2.0` |
@@ -73,6 +75,8 @@ yarn add @adshift/react-native-plugin
73
75
  cd ios && pod install
74
76
  ```
75
77
 
78
+ The AdShift iOS SDK comes inside the plugin package, so `pod install` fetches nothing for it. Do not add the SDK to your app yourself, neither through CocoaPods (`pod 'AdshiftSDK'`) nor through Swift Package Manager. Your app's own native code can still `import AdshiftSDK`.
79
+
76
80
  Then add the two `RCTLinkingManager` handlers to `AppDelegate.swift` (see [Platform Setup → iOS](#ios)); the plugin relies on them to receive links while the app is running.
77
81
 
78
82
  **Android** — the module autolinks. See [Platform Setup → Android](#android) for backup rules, the `AD_ID` permission and the one `MainActivity` override deep links need.
@@ -144,9 +148,9 @@ interface StartResult {
144
148
  }
145
149
  ```
146
150
 
147
- - The API key is verified with the AdShift backend in the background. `apiKeyValidationStatus` is the verdict at the moment `start()` resolved: `valid`, `invalid`, or `pending` while the answer is not in. `config.onError` reports `INVALID_API_KEY` when `start()` itself returns `invalid`. On iOS the verdict usually arrives after `start()` resolved, so a rejected key is reported by the next `start()`; on Android `start()` waits up to 5 s for it. Events tracked meanwhile stay queued on the device by the native SDK.
151
+ - The API key is verified with the AdShift backend in the background. `apiKeyValidationStatus` is the verdict at the moment `start()` resolved: `valid`, `invalid`, or `pending` while the answer is not in. `config.onError` reports `INVALID_API_KEY` when `start()` itself returns `invalid`. On iOS the verdict usually arrives after `start()` resolved, so a rejected key is reported by the next `start()`; on Android `start()` waits up to 5 s for it.
148
152
  - A device excluded from tracking resolves `{ success: false, errorCode: 'OPTED_OUT' }`.
149
- - On iOS `start()` resolves after the local set-up and does not wait for the ATT decision or the SKAdNetwork configuration. With `waitForATTBeforeStart` the native SDK records events as usual and holds their delivery until the ATT decision, up to `attTimeoutMs`.
153
+ - On iOS `start()` resolves after the local set-up and does not wait for the ATT decision or the SKAdNetwork configuration. With `waitForATTBeforeStart` events are delivered after the ATT decision, at the latest after `attTimeoutMs`.
150
154
  - Calling `start()` again while started resolves `{ success: true }` immediately. Calling it before `initialize()` resolves `{ success: false, errorCode: 'NOT_INITIALIZED' }`.
151
155
  - Everything queued with `trackEvent`, `trackPurchase` and `logAdRevenue` between `initialize()` and a successful `start()` is dispatched in order when `start()` succeeds. If the start failed for a reason retrying cannot fix — `INVALID_API_KEY`, `OPTED_OUT`, `NOT_INITIALIZED` — the queued promises reject with that code. If it failed for any other reason, they keep waiting for the next `start()`, so the data survives a start that failed while the device was offline. Queued promises stay pending until some `start()` finishes, which is why `start()` belongs on every launch path.
152
156
 
@@ -154,7 +158,7 @@ interface StartResult {
154
158
 
155
159
  Pauses delivery. Tracking calls reject with `NOT_STARTED` until the next successful `start()`. This is not an opt-out; opt-out is configured on the AdShift side.
156
160
 
157
- Links keep reaching `onDeepLink` after `stop()`, so your app can still route; nothing is sent while the SDK is stopped. Configuration setters and `refreshConsent()` also keep working, so consent changes apply while delivery is paused. Calls queued before the interrupted `start()` reject with `NOT_STARTED`.
161
+ Links keep reaching `onDeepLink` after `stop()`, so your app can still route, but their clicks are not counted, and a short link arrives as tapped, without `deepLinkValue`. Nothing is sent until the next `start()`. Configuration setters and `refreshConsent()` also keep working, so consent changes apply while delivery is paused. Calls queued before the interrupted `start()` reject with `NOT_STARTED`.
158
162
 
159
163
  ### `Adshift.isStarted(): boolean`
160
164
 
@@ -167,7 +171,7 @@ The AdShift device identifier; `null` before `initialize()`.
167
171
  ### `Adshift.getInfo()`
168
172
 
169
173
  ```typescript
170
- { platform: 'ios' | 'android', version: '3.0.0', nativeSdkVersions: { android: '4.1.0', ios: '3.0.0' } }
174
+ { platform: 'ios' | 'android', version: '3.1.0', nativeSdkVersions: { android: '4.2.0', ios: '3.1.0' } }
171
175
  ```
172
176
 
173
177
  ---
@@ -187,7 +191,7 @@ await Adshift.trackEvent('custom_event');
187
191
 
188
192
  `values` accepts strings, numbers and booleans (no nested objects). The promise resolves once the SDK has accepted the event; delivery is asynchronous and survives offline periods. Rejections use [`AdshiftError`](#errors).
189
193
 
190
- `app_install` and `app_open` are reserved — the SDK sends them itself, so passing them here rejects with `INVALID_ARGUMENT` instead of adding hand-made records to your install and session counts.
194
+ `app_install` and `app_open` are reserved — the SDK sends them itself, so passing them here rejects with `INVALID_ARGUMENT`.
191
195
 
192
196
  ### `Adshift.trackPurchase(params): Promise<void>`
193
197
 
@@ -215,7 +219,7 @@ await Adshift.trackPurchase({
215
219
  | Location | `LocationChanged`, `LocationCoordinates` |
216
220
  | Other | `OrderId`, `CustomerSegment` |
217
221
 
218
- `getAllEventTypes()` returns the wire names as an array.
222
+ `getAllEventTypes()` returns the event names as an array.
219
223
 
220
224
  ### Standard parameter names
221
225
 
@@ -254,7 +258,7 @@ await Adshift.logAdRevenue({
254
258
  });
255
259
  ```
256
260
 
257
- `mediationNetwork` must be an `AdshiftMediationNetwork` value (`AppLovinMAX`, `GoogleAdMob`, `IronSource`, `Chartboost`, `TopOn`, `TradPlus`, `AdMost`, `Appodeal`, `Fyber`, `Unity`, `Yandex`, `CustomMediation`, `DirectMonetization`, `Other`). `revenue` is the value of one impression and must be positive. The native SDKs drop an impression above 10 USD: iOS converts the amount to USD first, Android compares the amount as given, whatever the currency.
261
+ `mediationNetwork` must be an `AdshiftMediationNetwork` value (`AppLovinMAX`, `GoogleAdMob`, `IronSource`, `Chartboost`, `TopOn`, `TradPlus`, `AdMost`, `Appodeal`, `Fyber`, `Unity`, `Yandex`, `CustomMediation`, `DirectMonetization`, `Other`). `revenue` is the value of one impression and must be positive. An impression above 10 USD is not recorded; on Android the limit is 10 in whatever currency you pass.
258
262
 
259
263
  ---
260
264
 
@@ -265,7 +269,7 @@ await Adshift.logAdRevenue({
265
269
  - Every link that opens the app and reaches the SDK — direct, deferred (first launch after install) and push — produces an `onDeepLink` result, and each result is delivered once.
266
270
  - **Navigate only on `status === 'found'`.** `found` means a RightLink link — your `*.rightlink.me` host, a domain in `brandedDomains`, or your app's scheme wrapping one (`yourapp://rightlink?as_rl=<the link, percent-encoded>`) — or a deferred deep link with a value. Validate `deepLinkValue` before you use it: anyone can write a link.
267
271
  - Any other URL, your app's own links included, comes back `notFound` with the URL in `deepLink` and no `params`. Route your own links from there.
268
- - `error` means "not yet": a short link that could not be resolved, for example without a network. The tap is already counted; the SDK tries again for an hour and delivers `found` when the link resolves.
272
+ - `error` means "not yet": a short link that could not be resolved, for example without a network. `found` follows once the link resolves.
269
273
  - Results are delivered only through `onDeepLink`. `handleDeepLink()` and `handlePushNotification()` resolve when the SDK has accepted the input.
270
274
 
271
275
  ### `Adshift.onDeepLink(callback): DeepLinkSubscription`
@@ -311,17 +315,15 @@ interface AdshiftDeepLink {
311
315
  ```
312
316
 
313
317
  - `source` is `ul` on iOS and `app_link` on Android for a Universal Link or App Link (or a link you passed in yourself), `scheme`, `cta` (the open-in-app button of a RightLink page), `push`, `deferred` or `foreign` (a web link that is not a RightLink link); iOS adds `aak` (an AdAttributionKit re-engagement open) and Android `meta_applink`.
314
- - `matchGuaranteed` is `false` for a deferred result matched without a clipboard token or an advertising identifier: route the user, but do not sign them in or grant a reward because of it.
318
+ - `matchGuaranteed` is `false` when a deferred result is not certain to belong to this user: route them, but do not sign them in or grant a reward because of it.
315
319
 
316
320
  ### Automatic forwarding (default)
317
321
 
318
322
  With `autoHandleDeepLinks: true` (the default) you write no linking code:
319
323
 
320
- - **Android** — the plugin reads the launch Intent and every new Intent (App Links, custom schemes, push taps that carry `as_push_link`). Relaunches from Recents and the launcher are not re-processed, and neither is an Activity the system re-created (a rotation, a return after the process was killed).
324
+ - **Android** — the plugin reads the launch Intent and every new Intent (App Links, custom schemes, push taps that carry `as_push_link`). A relaunch from Recents or the launcher, or an Activity the system re-created (a rotation, a return after the process was killed), does not deliver its link again. A link that opened the app still arrives when Android killed the process before `initialize()`.
321
325
  - **iOS** — the plugin uses React Native's `Linking` (`getInitialURL` and the `url` event). Your `AppDelegate.swift` must forward URLs to `RCTLinkingManager` (see [Platform Setup → iOS](#ios)); without it links opened while the app is running never reach JavaScript.
322
326
 
323
- `start()` hands the launch URL to the SDK first, so the first `app_open` carries the click parameters.
324
-
325
327
  ### Manual forwarding
326
328
 
327
329
  Set `autoHandleDeepLinks: false` and forward URLs yourself:
@@ -330,15 +332,15 @@ Set `autoHandleDeepLinks: false` and forward URLs yourself:
330
332
  await Adshift.handleDeepLink(url); // resolves once accepted; result arrives via onDeepLink
331
333
  ```
332
334
 
333
- Rejects with `NOT_INITIALIZED` or `INVALID_ARGUMENT` (empty or malformed URL). If you keep an old `Linking → handleDeepLink` handler while automatic forwarding is on, nothing is counted twice: the same link handed over twice counts once.
335
+ Rejects with `NOT_INITIALIZED` or `INVALID_ARGUMENT` (empty or malformed URL). If you keep an old `Linking → handleDeepLink` handler while automatic forwarding is on, the link is still handled once.
334
336
 
335
337
  ### Deferred deep links
336
338
 
337
339
  On the first launch after install the SDK looks up the deferred deep link and answers through `onDeepLink` with `isDeferred: true` within 5 seconds of `start()`: the link, `notFound` or `error`. With `waitForATTBeforeStart` on iOS the 5 seconds count from the ATT answer. Nothing to configure.
338
340
 
339
- On iOS a deferred result has no `deepLink`: route on `deepLinkValue` and `deepLinkSub1`…`deepLinkSub5`. There is no lookup when the user denied ad storage or ad user data in your consent.
341
+ On iOS a deferred result has no `deepLink`: route on `deepLinkValue` and `deepLinkSub1`…`deepLinkSub5`, which `params` also holds as `deep_link_sub1`…`deep_link_sub5` on both platforms. There is no deferred deep link when the user denied ad storage or ad user data in your consent.
340
342
 
341
- **Clipboard (iOS)** — for RightLink templates with the clipboard option, the install finds its link without an advertising identifier. Set `deferredDeepLinkClipboard` in `initialize()`:
343
+ **Clipboard (iOS)** — for RightLink templates with the clipboard option, set `deferredDeepLinkClipboard` in `initialize()`:
342
344
 
343
345
  - `'prompt'` — the SDK reads the clipboard once per install; iOS asks the user to allow the paste.
344
346
  - `'pasteControl'` — your onboarding shows `UIPasteControl`, which pastes without asking, and you pass on what was pasted:
@@ -378,7 +380,7 @@ notifee.onForegroundEvent(({ type, detail }) => {
378
380
  });
379
381
  ```
380
382
 
381
- `handlePushNotification` resolves `true` when the payload carried an AdShift link (the result arrives through `onDeepLink`). The link must be a RightLink link with `pid` and `c` (or `campaign`), or a RightLink short link. Only taps should be forwarded, not deliveries. Call it before `start()` when the payload is known at launch, so the first `app_open` carries the push parameters.
383
+ `handlePushNotification` resolves `true` when the payload carried an AdShift link (the result arrives through `onDeepLink`). The link must be a RightLink link with `pid` and `c` (or `campaign`), or a RightLink short link. Only taps should be forwarded, not deliveries. Call it before `start()` when the payload is known at launch, so the launch is attributed to the push.
382
384
 
383
385
  ---
384
386
 
@@ -389,7 +391,7 @@ Set consent on every launch, before `start()`, and again whenever the user chang
389
391
  ### Manual consent
390
392
 
391
393
  ```typescript
392
- // User subject to GDPR; omitted flags are "not decided" and are not sent
394
+ // User subject to GDPR; omitted flags are "not decided"
393
395
  Adshift.setConsentData(
394
396
  AdshiftConsent.forGDPRUser({
395
397
  hasConsentForDataUsage: true,
@@ -398,7 +400,7 @@ Adshift.setConsentData(
398
400
  })
399
401
  );
400
402
 
401
- // User not subject to GDPR: everything is permitted, individual flags are not sent
403
+ // User not subject to GDPR: everything is permitted
402
404
  Adshift.setConsentData(AdshiftConsent.forNonGDPRUser());
403
405
  ```
404
406
 
@@ -416,10 +418,9 @@ const snapshot: ConsentSnapshot = await Adshift.refreshConsent();
416
418
 
417
419
  ### GPP (US state privacy)
418
420
 
419
- Two independent axes. `enableGPPDataCollection` forwards the IAB GPP string the
420
- CMP wrote, alongside whatever decides the GDPR axis — including a consent set
421
- through `setConsentData()`. It does not gate the advertising identifier on the
422
- device; a US opt-out limits what may be done with an event afterwards.
421
+ `enableGPPDataCollection` reads the IAB GPP string the CMP wrote, in addition to
422
+ the GDPR consent, including one set through `setConsentData()`. It does not gate
423
+ the advertising identifier.
423
424
 
424
425
  ```typescript
425
426
  Adshift.enableGPPDataCollection(true); // before start()
@@ -432,10 +433,10 @@ snapshot.gppPresent; // true once a GPP string is on the device
432
433
 
433
434
  ### Third-party sharing
434
435
 
435
- A third axis, and the one with the opposite default: nothing said here means
436
- sharing is allowed. So state it only once the user has actually been asked — a
437
- `allowed()` set at startup as a default records a declaration the user never
438
- made, and events already sent cannot be recalled when a real answer arrives.
436
+ Unlike consent, nothing said here means sharing is allowed. So state it only
437
+ once the user has actually been asked — an `allowed()` set at startup as a
438
+ default records a declaration the user never made, and events already sent
439
+ cannot be recalled when a real answer arrives.
439
440
 
440
441
  ```typescript
441
442
  // The user asked not to have their data passed on
@@ -448,8 +449,6 @@ Adshift.setThirdPartySharing(AdshiftThirdPartySharing.allowed());
448
449
  Adshift.clearThirdPartySharing();
449
450
  ```
450
451
 
451
- Nothing is gated on the device either way; the answer travels with the events.
452
-
453
452
  ```typescript
454
453
  interface ConsentSnapshot {
455
454
  source: 'manual' | 'tcf' | 'gpp' | 'none';
@@ -465,17 +464,14 @@ interface ConsentSnapshot {
465
464
  }
466
465
  ```
467
466
 
468
- `source` names what decided the GDPR axis, where manual outranks TCF. It is not a
469
- ranking across all three axes: a GPP string and a sharing answer ride alongside
470
- whatever `source` says, and neither is displaced by calling `setConsentData()`.
467
+ `source` names what decided GDPR consent; manual consent outranks TCF. GPP and
468
+ the sharing answer are separate, and `setConsentData()` does not replace them.
471
469
 
472
- `cmpDetected` separates the two states nothing else here can tell apart. A CMP
473
- installed but not yet answered looks identical to no CMP at all, and the two are
474
- fixed by opposite actions: `false` when you expect a CMP means it never ran or was
475
- never wired up, while `true` with `source: 'none'` means it ran and the user has
476
- not answered yet, which resolves itself once they do.
470
+ `cmpDetected` tells a CMP the user has not answered yet from no CMP at all:
471
+ `false` when you expect a CMP means it never ran or was never wired up, while
472
+ `true` with `source: 'none'` means it ran and the user has not answered yet.
477
473
 
478
- `adIdentifiersAllowed` answers whether consent lets the SDK attach the advertising identifier (GAID or OAID on Android, IDFA on iOS) to what it reports; the `adshift_device_id` is never affected. Both ad storage and ad user data have to be allowed, and each platform applies that to the flags its own way — under GDPR an undecided flag counts as a refusal on Android, while iOS refuses only on an explicit denial. Read this field instead of comparing the flags yourself.
474
+ `adIdentifiersAllowed` answers whether consent lets the SDK use the advertising identifier (GAID or OAID on Android, IDFA on iOS); the `adshift_device_id` is never affected. The platforms judge the flags by different rules, so read this field instead of comparing the flags yourself.
479
475
 
480
476
  ---
481
477
 
@@ -561,8 +557,8 @@ try {
561
557
  | `NOT_INITIALIZED` | `initialize()` has not been called |
562
558
  | `NOT_STARTED` | `stop()` was called; call `start()` |
563
559
  | `INVALID_API_KEY` | The backend rejected the API key |
564
- | `OPTED_OUT` | Tracking is disabled for this app on the AdShift side |
565
- | `QUEUE_FULL` | More than 100 calls are waiting for `start()`, or the Android SDK refused the call because its own queue is full |
560
+ | `OPTED_OUT` | Tracking is turned off for this device |
561
+ | `QUEUE_FULL` | More than 100 calls are waiting for `start()`, or the Android SDK could not take the call |
566
562
  | `INVALID_ARGUMENT` | A parameter failed validation |
567
563
  | `UNKNOWN` | Anything else; see `userInfo.nativeCode` |
568
564
 
@@ -574,7 +570,7 @@ try {
574
570
 
575
571
  ### iOS
576
572
 
577
- **1. Deployment target** — `platform :ios, '15.1'` or higher in `ios/Podfile` (React Native 0.82 already requires this). The plugin builds with the default static libraries, `use_frameworks! :linkage => :static` and dynamic frameworks.
573
+ **1. Deployment target** — `platform :ios, '15.1'` or higher in `ios/Podfile` (React Native 0.82 already requires this). The plugin builds with the default static libraries, `use_frameworks! :linkage => :static` and dynamic frameworks. It carries the AdShift iOS SDK; do not add `AdshiftSDK` yourself, neither through CocoaPods nor through Swift Package Manager.
578
574
 
579
575
  **2. `AppDelegate.swift`** — forward URLs to React Native so `Linking` (and the plugin) receive them. The bare React Native template does not include these methods; **Expo projects need none of this** (see [Expo](#expo)):
580
576
 
@@ -623,7 +619,7 @@ func application(
623
619
 
624
620
  The native SDK ships its own privacy manifest; the plugin adds no tracked APIs. For what to put in App Store Connect, see [Store Privacy Declarations](#store-privacy-declarations).
625
621
 
626
- **6. Pod linkage** — the plugin is built in all three CocoaPods linkage modes: the React Native default, where pods are static libraries, plus `use_frameworks! :linkage => :static` and `use_frameworks! :linkage => :dynamic`. Nothing extra is needed on your side for any of them.
622
+ **6. Pod linkage** — the plugin is built in all three CocoaPods linkage modes, on the oldest supported and the newest React Native: the React Native default, where pods are static libraries, plus `use_frameworks! :linkage => :static` and `use_frameworks! :linkage => :dynamic`. Nothing extra is needed on your side for any of them.
627
623
 
628
624
  ### Android
629
625
 
@@ -637,7 +633,7 @@ The native SDK ships its own privacy manifest; the plugin adds no tracked APIs.
637
633
  <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
638
634
  ```
639
635
 
640
- Without that permission the advertising id is no longer read, and attribution continues on the SDK's own install identifier. The OAID permissions and queries can be removed the same way — see the [Android SDK README](https://github.com/AdShift/android-sdk#permissions).
636
+ Without that permission the advertising id is not read. The OAID permissions and queries can be removed the same way — see the [Android SDK README](https://github.com/AdShift/android-sdk#permissions).
641
637
 
642
638
  **4. Backup rules** — the SDK manifest sets `android:fullBackupContent` and `android:dataExtractionRules` on `<application>` so its identifiers are never restored on a new install. The React Native template (`android:allowBackup="false"`, no rules attribute) merges cleanly. If your app declares its own rules attributes, the build fails with a manifest merger conflict: add `tools:replace` for the attributes you declare **and** copy the SDK's exclusions into your rules files — see the [Android SDK README, "Backup Rules"](https://github.com/AdShift/android-sdk#backup-rules).
643
639
 
@@ -652,7 +648,7 @@ override fun onNewIntent(intent: Intent) {
652
648
  }
653
649
  ```
654
650
 
655
- **6. Code shrinking** — the native SDK ships consumer ProGuard rules, so `minifyEnabled true` needs no keep rules of your own, and release builds with shrinking enabled are part of our build checks. Those rules keep the SDK's public API and its wire models and leave the rest to R8, so SDK frames in crash reports arrive obfuscated; upload your release `mapping.txt`. Do not add `-keep class com.adshift.sdk.** { *; }` — it is not needed and forces the whole native SDK into the APK unshrunk.
651
+ **6. Code shrinking** — the native SDK ships consumer ProGuard rules, so `minifyEnabled true` needs no keep rules of your own, and release builds with shrinking enabled are part of our build checks. SDK frames in crash reports arrive obfuscated; upload your release `mapping.txt`. Do not add `-keep class com.adshift.sdk.** { *; }` — it is not needed and forces the whole native SDK into the APK unshrunk.
656
652
 
657
653
  **7. Devices without Google Play services** — the SDK reads the OAID itself when `collectOaid` is on (the default). If your app already obtains it, pass it with `Adshift.setOaidData(oaid)` and set `collectOaid: false`.
658
654
 
@@ -685,9 +681,9 @@ Notes that decide several rows for you:
685
681
 
686
682
  - **The advertising id is optional in practice.** On Android it is read only while the `AD_ID` permission is present (see [Platform Setup → Android](#android)); on iOS only after the user allows tracking through ATT. Removing the permission, or never showing the ATT prompt, keeps the identifier out of your declaration — attribution continues on the SDK's own install identifier, which is still collected.
687
683
  - **Consent gates it too.** When you report a refusal through the consent API, the advertising id is withheld; `Adshift.refreshConsent()` returns `adIdentifiersAllowed` so you can see the current answer.
688
- - **No location permission or API is used.** The country reported by the SDK comes from the device's region setting. AdShift also derives the country and city from the IP address of each request, which is why the iOS SDK's privacy manifest declares Coarse Location; check your App Privacy answers against the privacy report Xcode generates.
684
+ - **No location permission or API is used.** The country reported by the SDK comes from the device's region setting. The iOS SDK's privacy manifest declares Coarse Location; check your App Privacy answers against the privacy report Xcode generates.
689
685
  - **Custom event parameters are yours.** Whatever you pass to `trackEvent` is sent as you wrote it, so anything personal in there belongs in your declaration.
690
- - **Only a RightLink link is sent, and only its attribution parameters.** Of its query the SDK sends `pid`, `c` or `campaign`, `is_retargeting`, `as_*`, `utm_*`, `deep_link_value`, `deep_link_sub1`…`5` and click ids; any other key stays on the device, in `params`. A URL that is not a RightLink link is not sent at all.
686
+ - **Only a RightLink link is sent, and only its attribution parameters.** Any other key of its query stays on the device, in `params`. A URL that is not a RightLink link is not sent at all.
691
687
  - **Everything travels over HTTPS.**
692
688
 
693
689
  Whether your app's data counts as "shared" under Play's definition, and whether the identifiers are used for tracking under Apple's definition, depends on your agreement with AdShift rather than on the SDK — settle those two with us before you submit.
@@ -732,9 +728,19 @@ The package ships both ES module and CommonJS builds, so the default `react-nati
732
728
 
733
729
  ---
734
730
 
731
+ ## Upgrading from 3.0
732
+
733
+ 3.1.x targets Android SDK 4.2.0 and iOS SDK 3.1.0 (see [Native SDK versions](#native-sdk-versions)). Nothing in the API changes.
734
+
735
+ - **iOS: the SDK comes inside the plugin.** If your `Podfile` has `pod 'AdshiftSDK'`, remove the line; `pod install` stops on it. Do not add `AdshiftSDK` through Swift Package Manager either.
736
+ - **After `stop()` a link's click is not counted on either platform.** On Android 3.0 counted it at the next `start()`. The link still reaches `onDeepLink`.
737
+ - **iOS: a deferred result has `deep_link_sub1`…`deep_link_sub5` in `params`**, as on Android.
738
+
739
+ ---
740
+
735
741
  ## Upgrading from 2.x
736
742
 
737
- 3.x targets Android SDK 4.1.0 and iOS SDK 3.0.0 (see [Native SDK versions](#native-sdk-versions)) and is a breaking release. Nothing in the API was removed or renamed; what changes is what `onDeepLink` delivers.
743
+ 3.0 targeted Android SDK 4.1.0 and iOS SDK 3.0.0 and was a breaking release. Nothing in the API was removed or renamed; what changes is what `onDeepLink` delivers.
738
744
 
739
745
  - **Route only on `status === 'found'`.** 2.x answered `found` for every URL. Now a URL that is not a RightLink link, your app's own scheme included, comes back `notFound`: route your own links from `deepLink` there.
740
746
  - **Declare every branded link domain in `brandedDomains`**, or its links come back `notFound` and are not counted.
@@ -766,7 +772,7 @@ New in 3.x: `AdshiftDeepLink.source`, `clickId` and `matchGuaranteed`, `AdshiftC
766
772
  - No method raises any more. Promises still reject; the rest report through `config.onError` and skip the call. Remove `try/catch` around `initialize()` and the setters, and read `onError` instead.
767
773
  - Setters called before `initialize()` are kept and applied afterwards instead of failing.
768
774
  - Deep links are forwarded automatically by default (`autoHandleDeepLinks`). Remove your `Linking.addEventListener('url', …) → handleDeepLink` code, or keep it — the plugin deduplicates its own forwards. On iOS add the `RCTLinkingManager` handlers to `AppDelegate.swift`.
769
- - Consent flags are tri-state (`boolean | null`); `AdshiftConsent.forGDPRUser()` accepts partial input and `forNonGDPRUser()` sends no individual flags. `AdshiftConsent.isConsentGranted` requires explicit `true`.
775
+ - Consent flags are tri-state (`boolean | null`); `AdshiftConsent.forGDPRUser()` accepts partial input. `AdshiftConsent.isConsentGranted` requires explicit `true`.
770
776
  - `refreshConsent()` resolves a typed `ConsentSnapshot`.
771
777
  - `AdshiftDeepLink.params` is `Record<string, string>`; `isFirstSession` added (Android).
772
778
  - `trackEvent`/`trackPurchase` calls before `start()` are queued (up to 100) instead of failing; after `stop()` they reject with `NOT_STARTED`.
@@ -797,6 +803,8 @@ Replace `API_KEYS` in `example/src/App.tsx` with keys from the AdShift dashboard
797
803
 
798
804
  ## Troubleshooting
799
805
 
806
+ **`pod install` stops with `The 'Pods-YourApp' target has frameworks with conflicting names: adshiftsdk.xcframework.`** — your `Podfile` adds the AdShift iOS SDK next to the copy inside the plugin. Remove `pod 'AdshiftSDK'` and run `pod install` again.
807
+
800
808
  **Links do not arrive on iOS while the app is running** — add the `RCTLinkingManager` methods to `AppDelegate.swift` ([Platform Setup → iOS](#ios)).
801
809
 
802
810
  **My own links stopped arriving as `found`** — only RightLink links are `found`. Route your own links on `notFound`, from `deepLink` ([Deep Linking](#deep-linking)).
@@ -83,9 +83,8 @@ dependencies {
83
83
  implementation "com.facebook.react:react-android"
84
84
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
85
85
 
86
- // AdShift Android SDK from Maven Central (exact pin; bumped with each plugin release)
87
- implementation "com.adshift:android-sdk:4.1.0"
88
- // Already in the app through the SDK; declared for RestoredIntentsInitializer.
86
+ implementation "com.adshift:android-sdk:4.2.0"
87
+ // Already in the app through the SDK; declared for ActivityIntentsInitializer.
89
88
  implementation "androidx.startup:startup-runtime:1.1.1"
90
89
 
91
90
  testImplementation "junit:junit:4.13.2"
@@ -1,21 +1,2 @@
1
- # Rules an app inherits by depending on this plugin.
2
- #
3
- # Intentionally empty. Two reasons, and both are worth knowing before adding
4
- # anything here.
5
- #
6
- # The native SDK ships its own consumer rules inside its AAR, and this plugin
7
- # depends on it, so an app that depends on the plugin inherits them. Those rules
8
- # cover the JSON layer the SDK reads by reflection: the Signature attribute, the
9
- # type-token hierarchy the persisted queues rely on, and the SDK's wire models.
10
- # A copy here would only duplicate them, and a copy that drifts is worse than no
11
- # copy at all.
12
- #
13
- # This plugin has no JSON models of its own and does not depend on Gson. Its
14
- # bridge classes are reached through React Native's module registry, which React
15
- # Native's own consumer rules keep, and the custom Gson adapters in the native
16
- # SDK are registered with constructed instances rather than by annotation, so
17
- # nothing needs a no-argument constructor kept.
18
- #
19
- # A rule added here applies to the whole of the integrating app, not just to
20
- # this plugin, so scope anything you do add. `-if class *` reaches the app's own
21
- # models and every other library's.
1
+ # Intentionally empty: the SDK, React Native and androidx.startup ship the rules this plugin
2
+ # needs. A rule here applies to the whole app, so scope any you add.
@@ -8,7 +8,7 @@
8
8
  android:exported="false"
9
9
  tools:node="merge">
10
10
  <meta-data
11
- android:name="com.adshift.reactnativeplugin.RestoredIntentsInitializer"
11
+ android:name="com.adshift.reactnativeplugin.ActivityIntentsInitializer"
12
12
  android:value="androidx.startup" />
13
13
  </provider>
14
14
  </application>