@adshift/react-native-plugin 1.0.0 → 2.0.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 (180) hide show
  1. package/AdShiftReactNativePlugin.podspec +11 -7
  2. package/CHANGELOG.md +122 -0
  3. package/README.md +506 -542
  4. package/android/build.gradle +17 -3
  5. package/android/consumer-rules.pro +21 -0
  6. package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +786 -229
  7. package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +180 -0
  8. package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +146 -0
  9. package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +111 -0
  10. package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +168 -0
  11. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +106 -0
  12. package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +167 -0
  13. package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +164 -0
  14. package/ios/AdShiftReactNativePlugin.h +7 -7
  15. package/ios/AdShiftReactNativePlugin.mm +200 -181
  16. package/ios/AdShiftReactNativePluginHelper.swift +584 -286
  17. package/ios/Core/BridgeRules.swift +82 -0
  18. package/lib/commonjs/Adshift.js +1135 -0
  19. package/lib/commonjs/Adshift.js.map +1 -0
  20. package/lib/commonjs/NativeAdShiftReactNativePlugin.js +22 -0
  21. package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -0
  22. package/lib/commonjs/index.js +94 -0
  23. package/lib/commonjs/index.js.map +1 -0
  24. package/lib/commonjs/jest/index.js +164 -0
  25. package/lib/commonjs/jest/index.js.map +1 -0
  26. package/lib/commonjs/nativeSdkVersions.js +17 -0
  27. package/lib/commonjs/nativeSdkVersions.js.map +1 -0
  28. package/lib/commonjs/package.json +1 -0
  29. package/lib/commonjs/types/AdshiftAdRevenue.js +47 -0
  30. package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -0
  31. package/lib/commonjs/types/AdshiftConfig.js +45 -0
  32. package/lib/commonjs/types/AdshiftConfig.js.map +1 -0
  33. package/lib/commonjs/types/AdshiftConsent.js +113 -0
  34. package/lib/commonjs/types/AdshiftConsent.js.map +1 -0
  35. package/lib/commonjs/types/AdshiftConsentSnapshot.js +69 -0
  36. package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -0
  37. package/lib/commonjs/types/AdshiftDeepLink.js +154 -0
  38. package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -0
  39. package/lib/commonjs/types/AdshiftError.js +91 -0
  40. package/lib/commonjs/types/AdshiftError.js.map +1 -0
  41. package/lib/commonjs/types/AdshiftEventParam.js +140 -0
  42. package/lib/commonjs/types/AdshiftEventParam.js.map +1 -0
  43. package/lib/commonjs/types/AdshiftEventType.js +88 -0
  44. package/lib/commonjs/types/AdshiftEventType.js.map +1 -0
  45. package/lib/commonjs/types/AdshiftThirdPartySharing.js +70 -0
  46. package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -0
  47. package/lib/commonjs/types/index.js +123 -0
  48. package/lib/commonjs/types/index.js.map +1 -0
  49. package/lib/commonjs/version.js +9 -0
  50. package/lib/commonjs/version.js.map +1 -0
  51. package/lib/module/Adshift.js +959 -296
  52. package/lib/module/Adshift.js.map +1 -1
  53. package/lib/module/NativeAdShiftReactNativePlugin.js +10 -7
  54. package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
  55. package/lib/module/index.js +26 -25
  56. package/lib/module/index.js.map +1 -1
  57. package/lib/module/jest/index.js +144 -0
  58. package/lib/module/jest/index.js.map +1 -0
  59. package/lib/module/nativeSdkVersions.js +13 -0
  60. package/lib/module/nativeSdkVersions.js.map +1 -0
  61. package/lib/module/types/AdshiftAdRevenue.js +43 -0
  62. package/lib/module/types/AdshiftAdRevenue.js.map +1 -0
  63. package/lib/module/types/AdshiftConfig.js +23 -26
  64. package/lib/module/types/AdshiftConfig.js.map +1 -1
  65. package/lib/module/types/AdshiftConsent.js +57 -50
  66. package/lib/module/types/AdshiftConsent.js.map +1 -1
  67. package/lib/module/types/AdshiftConsentSnapshot.js +65 -0
  68. package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -0
  69. package/lib/module/types/AdshiftDeepLink.js +97 -67
  70. package/lib/module/types/AdshiftDeepLink.js.map +1 -1
  71. package/lib/module/types/AdshiftError.js +87 -0
  72. package/lib/module/types/AdshiftError.js.map +1 -0
  73. package/lib/module/types/AdshiftEventParam.js +135 -0
  74. package/lib/module/types/AdshiftEventParam.js.map +1 -0
  75. package/lib/module/types/AdshiftEventType.js +11 -36
  76. package/lib/module/types/AdshiftEventType.js.map +1 -1
  77. package/lib/module/types/AdshiftThirdPartySharing.js +65 -0
  78. package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -0
  79. package/lib/module/types/index.js +9 -7
  80. package/lib/module/types/index.js.map +1 -1
  81. package/lib/module/version.js +5 -0
  82. package/lib/module/version.js.map +1 -0
  83. package/lib/typescript/commonjs/package.json +1 -0
  84. package/lib/typescript/commonjs/src/Adshift.d.ts +311 -0
  85. package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  87. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/index.d.ts +51 -0
  89. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/jest/index.d.ts +103 -0
  91. package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +11 -0
  93. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +56 -0
  95. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +104 -0
  97. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +76 -0
  99. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  101. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +89 -0
  103. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +57 -0
  105. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +111 -0
  107. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -0
  108. package/lib/typescript/{src → commonjs/src}/types/AdshiftEventType.d.ts +12 -35
  109. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  111. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/src/types/index.d.ts +17 -0
  113. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/version.d.ts +2 -0
  115. package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
  116. package/lib/typescript/module/src/Adshift.d.ts +311 -0
  117. package/lib/typescript/module/src/Adshift.d.ts.map +1 -0
  118. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  119. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  120. package/lib/typescript/module/src/index.d.ts +51 -0
  121. package/lib/typescript/module/src/index.d.ts.map +1 -0
  122. package/lib/typescript/module/src/jest/index.d.ts +103 -0
  123. package/lib/typescript/module/src/jest/index.d.ts.map +1 -0
  124. package/lib/typescript/module/src/nativeSdkVersions.d.ts +11 -0
  125. package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -0
  126. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +56 -0
  127. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  128. package/lib/typescript/module/src/types/AdshiftConfig.d.ts +104 -0
  129. package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -0
  130. package/lib/typescript/module/src/types/AdshiftConsent.d.ts +76 -0
  131. package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -0
  132. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  133. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  134. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +89 -0
  135. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -0
  136. package/lib/typescript/module/src/types/AdshiftError.d.ts +57 -0
  137. package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -0
  138. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +111 -0
  139. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -0
  140. package/lib/typescript/module/src/types/AdshiftEventType.d.ts +64 -0
  141. package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -0
  142. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  143. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  144. package/lib/typescript/module/src/types/index.d.ts +17 -0
  145. package/lib/typescript/module/src/types/index.d.ts.map +1 -0
  146. package/lib/typescript/module/src/version.d.ts +2 -0
  147. package/lib/typescript/module/src/version.d.ts.map +1 -0
  148. package/package.json +49 -10
  149. package/src/Adshift.ts +1273 -342
  150. package/src/NativeAdShiftReactNativePlugin.ts +81 -115
  151. package/src/index.tsx +40 -25
  152. package/src/jest/index.ts +224 -0
  153. package/src/nativeSdkVersions.ts +10 -0
  154. package/src/types/AdshiftAdRevenue.ts +58 -0
  155. package/src/types/AdshiftConfig.ts +101 -53
  156. package/src/types/AdshiftConsent.ts +75 -72
  157. package/src/types/AdshiftConsentSnapshot.ts +103 -0
  158. package/src/types/AdshiftDeepLink.ts +123 -102
  159. package/src/types/AdshiftError.ts +107 -0
  160. package/src/types/AdshiftEventParam.ts +216 -0
  161. package/src/types/AdshiftEventType.ts +13 -35
  162. package/src/types/AdshiftThirdPartySharing.ts +63 -0
  163. package/src/types/index.ts +38 -6
  164. package/src/version.ts +2 -0
  165. package/lib/typescript/src/Adshift.d.ts +0 -335
  166. package/lib/typescript/src/Adshift.d.ts.map +0 -1
  167. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts +0 -143
  168. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts.map +0 -1
  169. package/lib/typescript/src/index.d.ts +0 -47
  170. package/lib/typescript/src/index.d.ts.map +0 -1
  171. package/lib/typescript/src/types/AdshiftConfig.d.ts +0 -74
  172. package/lib/typescript/src/types/AdshiftConfig.d.ts.map +0 -1
  173. package/lib/typescript/src/types/AdshiftConsent.d.ts +0 -88
  174. package/lib/typescript/src/types/AdshiftConsent.d.ts.map +0 -1
  175. package/lib/typescript/src/types/AdshiftDeepLink.d.ts +0 -93
  176. package/lib/typescript/src/types/AdshiftDeepLink.d.ts.map +0 -1
  177. package/lib/typescript/src/types/AdshiftEventType.d.ts.map +0 -1
  178. package/lib/typescript/src/types/index.d.ts +0 -5
  179. package/lib/typescript/src/types/index.d.ts.map +0 -1
  180. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -1,143 +0,0 @@
1
- import { type TurboModule } from 'react-native';
2
- /**
3
- * AdShift React Native Plugin - Turbo Module Specification
4
- *
5
- * This interface defines the contract between JavaScript and native code.
6
- * Codegen generates native interfaces from this spec:
7
- * - iOS: NativeAdShiftReactNativePluginSpecJSI (C++)
8
- * - Android: NativeAdShiftReactNativePluginSpec (Kotlin)
9
- *
10
- * Note: Custom types (AdshiftConfig, etc.) are not supported in Turbo Module Spec.
11
- * We use `Object` here and add type safety in the wrapper layer (Adshift.ts).
12
- */
13
- export interface Spec extends TurboModule {
14
- /**
15
- * Initializes the SDK with configuration.
16
- * Must be called before start().
17
- *
18
- * @param config - Configuration object containing:
19
- * - apiKey: string (required)
20
- * - isDebug?: boolean
21
- * - appOpenDebounceMs?: number
22
- * - disableSKAN?: boolean (iOS only)
23
- * - waitForATTBeforeStart?: boolean (iOS only)
24
- * - attTimeoutMs?: number (iOS only)
25
- * - collectOaid?: boolean (Android only)
26
- */
27
- initialize(config: Object): void;
28
- /**
29
- * Starts the SDK.
30
- * Validates API key, sends install event (if first launch), and begins tracking.
31
- *
32
- * @returns Promise resolving to result object or rejecting with error
33
- */
34
- start(): Promise<Object>;
35
- /**
36
- * Stops the SDK.
37
- * Pauses all tracking. Can be restarted with start().
38
- */
39
- stop(): void;
40
- /**
41
- * Checks if SDK is currently started.
42
- *
43
- * @returns true if SDK is running
44
- */
45
- isStarted(): boolean;
46
- /**
47
- * Sets custom user identifier for attribution.
48
- * Can be called before or after start().
49
- *
50
- * @param userId - Your user identifier
51
- */
52
- setCustomerUserId(userId: string): void;
53
- /**
54
- * Enables/disables debug logging at runtime.
55
- *
56
- * @param enabled - true to enable debug logs
57
- */
58
- setDebugEnabled(enabled: boolean): void;
59
- /**
60
- * Sets app open debounce time in milliseconds.
61
- * Used to deduplicate rapid app open events.
62
- *
63
- * @param ms - Debounce time in milliseconds
64
- */
65
- setAppOpenDebounceMs(ms: number): void;
66
- /**
67
- * Sets user consent data manually.
68
- * Use for custom consent UI (not CMP).
69
- *
70
- * @param consent - Consent object containing:
71
- * - isUserSubjectToGDPR: boolean
72
- * - hasConsentForDataUsage: boolean
73
- * - hasConsentForAdsPersonalization: boolean
74
- * - hasConsentForAdStorage: boolean
75
- */
76
- setConsentData(consent: Object): void;
77
- /**
78
- * Enables/disables automatic TCF v2.2 data collection from CMP.
79
- * Call BEFORE start() to enable consent collection from CMPs
80
- * (Google Funding Choices, Didomi, etc.)
81
- *
82
- * @param enabled - true to enable TCF collection
83
- */
84
- enableTCFDataCollection(enabled: boolean): void;
85
- /**
86
- * Refreshes consent state from TCF/CMP or manual sources.
87
- * Call this after CMP dialog closes to pick up updated consent.
88
- *
89
- * @returns Promise resolving to consent snapshot
90
- */
91
- refreshConsent(): Promise<Object>;
92
- /**
93
- * Tracks an in-app event with optional parameters.
94
- * Events are queued until SDK is started.
95
- *
96
- * @param eventName - Event name (use AdshiftEventType constants or custom string)
97
- * @param values - Optional event parameters (nullable)
98
- * @returns Promise resolving on success or rejecting with error
99
- */
100
- trackEvent(eventName: string, values: Object | null): Promise<void>;
101
- /**
102
- * Tracks a purchase event with standardized parameters.
103
- *
104
- * @param productId - Product identifier
105
- * @param price - Purchase amount
106
- * @param currency - ISO currency code (e.g., "USD")
107
- * @param token - Purchase token/receipt
108
- * @returns Promise resolving on success or rejecting with error
109
- */
110
- trackPurchase(productId: string, price: number, currency: string, token: string): Promise<void>;
111
- /**
112
- * Handles a deep link URL.
113
- * Extracts campaign parameters for attribution.
114
- *
115
- * @param url - Deep link URL string
116
- * @returns Promise resolving to deep link response object containing:
117
- * - deepLink?: string
118
- * - deepLinkValue?: string
119
- * - params?: Object
120
- * - isDeferred: boolean
121
- * - status: 'found' | 'notFound' | 'error'
122
- * - errorMessage?: string
123
- * - deepLinkSub1-5?: string
124
- */
125
- handleDeepLink(url: string): Promise<Object>;
126
- /**
127
- * Registers a listener for native events.
128
- * Called internally by NativeEventEmitter.
129
- *
130
- * @param eventType - Event name to listen for
131
- */
132
- addListener(eventType: string): void;
133
- /**
134
- * Removes event listeners.
135
- * Called internally by NativeEventEmitter.
136
- *
137
- * @param count - Number of listeners to remove
138
- */
139
- removeListeners(count: number): void;
140
- }
141
- declare const _default: Spec;
142
- export default _default;
143
- //# sourceMappingURL=NativeAdShiftReactNativePlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeAdShiftReactNativePlugin.d.ts","sourceRoot":"","sources":["../../../src/NativeAdShiftReactNativePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IAGvC;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC;IAIrB;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAExC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAIvC;;;;;;;;;OASG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEhD;;;;;OAKG;IACH,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAIlC;;;;;;;OAOG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE;;;;;;;;OAQG;IACH,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IAIjB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAK7C;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAEE"}
@@ -1,47 +0,0 @@
1
- /**
2
- * AdShift React Native Plugin
3
- *
4
- * Mobile Attribution, Event Tracking, SKAdNetwork 4.0+, Deep Linking
5
- * and GDPR/TCF 2.2 Compliance.
6
- *
7
- * @example
8
- * ```typescript
9
- * import {
10
- * Adshift,
11
- * AdshiftEventType,
12
- * AdshiftConsent,
13
- * AdshiftDeepLinkStatus,
14
- * } from '@adshift/react-native-plugin';
15
- *
16
- * // 1. Initialize
17
- * Adshift.initialize({ apiKey: 'your-api-key', isDebug: __DEV__ });
18
- *
19
- * // 2. Start tracking
20
- * await Adshift.start();
21
- *
22
- * // 3. Track events
23
- * await Adshift.trackEvent(AdshiftEventType.Purchase, { price: 9.99 });
24
- *
25
- * // 4. Handle deep links
26
- * const subscription = Adshift.onDeepLink((deepLink) => {
27
- * if (deepLink.status === AdshiftDeepLinkStatus.Found) {
28
- * // Navigate based on deep link
29
- * }
30
- * });
31
- * ```
32
- *
33
- * @packageDocumentation
34
- */
35
- export { Adshift, default } from './Adshift';
36
- export type { StartResult, EventValues, PurchaseParams, DeepLinkSubscription, DeepLinkCallback, } from './Adshift';
37
- export type { AdshiftConfig } from './types';
38
- export { configToMap } from './types';
39
- export { AdshiftConsent, consentToMap } from './types';
40
- export type { AdshiftConsent as AdshiftConsentType } from './types';
41
- export { AdshiftDeepLinkStatus, AdshiftDeepLink, deepLinkToMap } from './types';
42
- export type { AdshiftDeepLink as AdshiftDeepLinkType } from './types';
43
- export { AdshiftEventType, getAllEventTypes } from './types';
44
- export type { AdshiftEventTypeValue } from './types';
45
- export { default as NativeAdShiftReactNativePlugin } from './NativeAdShiftReactNativePlugin';
46
- export type { Spec as AdShiftNativeSpec } from './NativeAdShiftReactNativePlugin';
47
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,YAAY,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIpE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChF,YAAY,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGtE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGrD,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,YAAY,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Configuration for initializing the AdShift SDK.
3
- *
4
- * @example
5
- * ```typescript
6
- * const config: AdshiftConfig = {
7
- * apiKey: 'your-api-key',
8
- * isDebug: true,
9
- * };
10
- * await Adshift.initialize(config);
11
- * ```
12
- */
13
- export interface AdshiftConfig {
14
- /**
15
- * API key for authenticating with AdShift backend.
16
- *
17
- * Required. Get your API key from the AdShift dashboard.
18
- */
19
- apiKey: string;
20
- /**
21
- * Enable debug logging.
22
- *
23
- * When true, SDK will output verbose logs for debugging.
24
- * @default false
25
- */
26
- isDebug?: boolean;
27
- /**
28
- * Debounce interval for automatic APP_OPEN events (in milliseconds).
29
- *
30
- * Controls how often APP_OPEN events are sent when app returns from background.
31
- * @default 10000 (10 seconds)
32
- */
33
- appOpenDebounceMs?: number;
34
- /**
35
- * Disable SKAdNetwork integration (iOS only).
36
- *
37
- * Set to true to completely disable SKAN functionality.
38
- * @default false (SKAN enabled)
39
- * @platform ios
40
- */
41
- disableSKAN?: boolean;
42
- /**
43
- * Wait for ATT authorization before sending install event (iOS only).
44
- *
45
- * When enabled, SDK will wait for App Tracking Transparency authorization
46
- * before sending the install event to include IDFA if user grants permission.
47
- * @default false
48
- * @platform ios
49
- */
50
- waitForATTBeforeStart?: boolean;
51
- /**
52
- * Timeout for ATT authorization wait in milliseconds (iOS only).
53
- *
54
- * Maximum time to wait for ATT response when `waitForATTBeforeStart` is enabled.
55
- * Range: 5000 - 120000 (5s - 2 minutes)
56
- * @default 30000 (30 seconds)
57
- * @platform ios
58
- */
59
- attTimeoutMs?: number;
60
- /**
61
- * Enable OAID collection (Android only).
62
- *
63
- * OAID is an alternative to Google Advertising ID used on Chinese Android devices.
64
- * @default true
65
- * @platform android
66
- */
67
- collectOaid?: boolean;
68
- }
69
- /**
70
- * Converts AdshiftConfig to a plain object for native bridge communication.
71
- * Filters out undefined values.
72
- */
73
- export declare function configToMap(config: AdshiftConfig): Record<string, unknown>;
74
- //# sourceMappingURL=AdshiftConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdshiftConfig.d.ts","sourceRoot":"","sources":["../../../../src/types/AdshiftConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI3B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwB1E"}
@@ -1,88 +0,0 @@
1
- /**
2
- * User consent data for GDPR/DMA compliance.
3
- *
4
- * @example
5
- * ```typescript
6
- * // For GDPR users who accepted all
7
- * const consent = AdshiftConsent.forGDPRUser({
8
- * hasConsentForDataUsage: true,
9
- * hasConsentForAdsPersonalization: true,
10
- * hasConsentForAdStorage: true,
11
- * });
12
- *
13
- * // For non-GDPR users
14
- * const consent = AdshiftConsent.forNonGDPRUser();
15
- *
16
- * await Adshift.setConsentData(consent);
17
- * ```
18
- */
19
- export interface AdshiftConsent {
20
- /**
21
- * Whether the user is subject to GDPR.
22
- */
23
- isUserSubjectToGDPR: boolean;
24
- /**
25
- * Whether user has consented to data usage.
26
- */
27
- hasConsentForDataUsage: boolean;
28
- /**
29
- * Whether user has consented to ads personalization.
30
- */
31
- hasConsentForAdsPersonalization: boolean;
32
- /**
33
- * Whether user has consented to ad storage.
34
- */
35
- hasConsentForAdStorage: boolean;
36
- }
37
- /**
38
- * Helper functions for creating AdshiftConsent objects.
39
- */
40
- export declare const AdshiftConsent: {
41
- /**
42
- * Creates consent for a user subject to GDPR.
43
- *
44
- * Use this when user is in a GDPR region and has provided explicit consent.
45
- *
46
- * @example
47
- * ```typescript
48
- * const consent = AdshiftConsent.forGDPRUser({
49
- * hasConsentForDataUsage: true,
50
- * hasConsentForAdsPersonalization: true,
51
- * hasConsentForAdStorage: true,
52
- * });
53
- * ```
54
- */
55
- forGDPRUser(options: {
56
- hasConsentForDataUsage: boolean;
57
- hasConsentForAdsPersonalization: boolean;
58
- hasConsentForAdStorage: boolean;
59
- }): AdshiftConsent;
60
- /**
61
- * Creates consent for a user NOT subject to GDPR.
62
- *
63
- * Use this when user is in a non-GDPR region (e.g., US, Asia).
64
- * All consent flags are set to true by default.
65
- *
66
- * @example
67
- * ```typescript
68
- * const consent = AdshiftConsent.forNonGDPRUser();
69
- * ```
70
- */
71
- forNonGDPRUser(): AdshiftConsent;
72
- /**
73
- * Determines whether consent is granted for tracking.
74
- *
75
- * If user is not subject to GDPR, consent is assumed granted.
76
- * If subject to GDPR, both data usage and ad storage must be granted.
77
- */
78
- isConsentGranted(consent: AdshiftConsent): boolean;
79
- /**
80
- * Creates consent from a plain object (native bridge response).
81
- */
82
- fromMap(map: Record<string, unknown>): AdshiftConsent;
83
- };
84
- /**
85
- * Converts AdshiftConsent to a plain object for native bridge communication.
86
- */
87
- export declare function consentToMap(consent: AdshiftConsent): Record<string, boolean>;
88
- //# sourceMappingURL=AdshiftConsent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdshiftConsent.d.ts","sourceRoot":"","sources":["../../../../src/types/AdshiftConsent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,+BAA+B,EAAE,OAAO,CAAC;IAEzC;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;;;;;;;;;;;;OAaG;yBACkB;QACnB,sBAAsB,EAAE,OAAO,CAAC;QAChC,+BAA+B,EAAE,OAAO,CAAC;QACzC,sBAAsB,EAAE,OAAO,CAAC;KACjC,GAAG,cAAc;IASlB;;;;;;;;;;OAUG;sBACe,cAAc;IAShC;;;;;OAKG;8BACuB,cAAc,GAAG,OAAO;IAKlD;;OAEG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc;CAStD,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAO7E"}
@@ -1,93 +0,0 @@
1
- /**
2
- * Status of a deep link resolution.
3
- */
4
- export declare enum AdshiftDeepLinkStatus {
5
- /** Deep link was found and resolved successfully. */
6
- Found = "found",
7
- /** No deep link was found (e.g., organic install). */
8
- NotFound = "notFound",
9
- /** Error occurred while resolving deep link. */
10
- Error = "error"
11
- }
12
- /**
13
- * Response from deep link handling.
14
- *
15
- * Contains the resolved deep link URL, parameters, and status.
16
- *
17
- * @example
18
- * ```typescript
19
- * const deepLink = await Adshift.handleDeepLink(url);
20
- * if (deepLink.status === AdshiftDeepLinkStatus.Found) {
21
- * const productId = deepLink.params?.['product_id'];
22
- * // Navigate to product
23
- * }
24
- * ```
25
- */
26
- export interface AdshiftDeepLink {
27
- /** The deep link URL string. */
28
- deepLink?: string;
29
- /**
30
- * Standardized resolved value for routing.
31
- * This is the main routing value extracted from the deep link.
32
- */
33
- deepLinkValue?: string;
34
- /** Query parameters extracted from the deep link. */
35
- params?: Record<string, unknown>;
36
- /**
37
- * Whether this is a deferred deep link.
38
- *
39
- * Deferred deep links are resolved after app install,
40
- * typically from ad campaigns.
41
- */
42
- isDeferred: boolean;
43
- /** Status of the deep link resolution. */
44
- status: AdshiftDeepLinkStatus;
45
- /** Error message if status is Error. */
46
- errorMessage?: string;
47
- /** Custom sub-parameter 1. */
48
- deepLinkSub1?: string;
49
- /** Custom sub-parameter 2. */
50
- deepLinkSub2?: string;
51
- /** Custom sub-parameter 3. */
52
- deepLinkSub3?: string;
53
- /** Custom sub-parameter 4. */
54
- deepLinkSub4?: string;
55
- /** Custom sub-parameter 5. */
56
- deepLinkSub5?: string;
57
- }
58
- /**
59
- * Helper functions for creating AdshiftDeepLink objects.
60
- */
61
- export declare const AdshiftDeepLink: {
62
- /**
63
- * Creates a successful deep link response.
64
- */
65
- found(options: {
66
- deepLink: string;
67
- deepLinkValue?: string;
68
- params?: Record<string, unknown>;
69
- isDeferred?: boolean;
70
- deepLinkSub1?: string;
71
- deepLinkSub2?: string;
72
- deepLinkSub3?: string;
73
- deepLinkSub4?: string;
74
- deepLinkSub5?: string;
75
- }): AdshiftDeepLink;
76
- /**
77
- * Creates a "not found" deep link response.
78
- */
79
- notFound(): AdshiftDeepLink;
80
- /**
81
- * Creates an error deep link response.
82
- */
83
- error(message: string): AdshiftDeepLink;
84
- /**
85
- * Creates deep link from a plain object (native bridge response).
86
- */
87
- fromMap(map: Record<string, unknown>): AdshiftDeepLink;
88
- };
89
- /**
90
- * Converts AdshiftDeepLink to a plain object for native bridge communication.
91
- */
92
- export declare function deepLinkToMap(deepLink: AdshiftDeepLink): Record<string, unknown>;
93
- //# sourceMappingURL=AdshiftDeepLink.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdshiftDeepLink.d.ts","sourceRoot":"","sources":["../../../../src/types/AdshiftDeepLink.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,qDAAqD;IACrD,KAAK,UAAU;IAEf,sDAAsD;IACtD,QAAQ,aAAa;IAErB,gDAAgD;IAChD,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB,0CAA0C;IAC1C,MAAM,EAAE,qBAAqB,CAAC;IAE9B,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;mBACY;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,eAAe;IAenB;;OAEG;gBACS,eAAe;IAO3B;;OAEG;mBACY,MAAM,GAAG,eAAe;IAQvC;;OAEG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe;CA2CvD,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdshiftEventType.d.ts","sourceRoot":"","sources":["../../../../src/types/AdshiftEventType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB;IAG3B,+BAA+B;;IAG/B,mCAAmC;;IAGnC,+BAA+B;;IAG/B,+BAA+B;;IAG/B,iCAAiC;;IAGjC,mCAAmC;;IAGnC,mCAAmC;;IAGnC,qBAAqB;;IAKrB,mCAAmC;;IAGnC,sBAAsB;;IAGtB,+BAA+B;;IAG/B,uBAAuB;;IAGvB,4BAA4B;;IAK5B,6BAA6B;;IAG7B,oCAAoC;;IAGpC,mCAAmC;;IAKnC,kCAAkC;;IAGlC,2BAA2B;;IAG3B,2BAA2B;;IAG3B,oCAAoC;;IAGpC,4BAA4B;;IAG5B,0CAA0C;;IAK1C,kCAAkC;;IAKlC,0BAA0B;;IAG1B,yBAAyB;;IAKzB,6BAA6B;;IAG7B,yCAAyC;;IAKzC,sBAAsB;;IAGtB,8BAA8B;;CAEtB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C"}
@@ -1,5 +0,0 @@
1
- export * from './AdshiftConfig';
2
- export * from './AdshiftConsent';
3
- export * from './AdshiftDeepLink';
4
- export * from './AdshiftEventType';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}