@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.
- package/AdShiftReactNativePlugin.podspec +20 -4
- package/CHANGELOG.md +30 -17
- package/README.md +55 -47
- package/android/build.gradle +2 -3
- package/android/consumer-rules.pro +2 -21
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/adshift/reactnativeplugin/ActivityIntents.kt +307 -0
- package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +83 -157
- package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +0 -20
- package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +0 -4
- package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +37 -5
- package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +0 -5
- package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +7 -26
- package/android/src/test/java/com/adshift/reactnativeplugin/LaunchLinkRecordTest.kt +420 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +93 -34
- package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +0 -4
- package/ios/AdShiftReactNativePlugin.h +0 -12
- package/ios/AdShiftReactNativePlugin.mm +2 -14
- package/ios/AdShiftReactNativePluginHelper.swift +14 -73
- package/ios/Core/BridgeRules.swift +24 -29
- package/lib/commonjs/Adshift.js +78 -285
- package/lib/commonjs/Adshift.js.map +1 -1
- package/lib/commonjs/NativeAdShiftReactNativePlugin.js +2 -11
- package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/jest/index.js +4 -18
- package/lib/commonjs/jest/index.js.map +1 -1
- package/lib/commonjs/nativeSdkVersions.js +4 -6
- package/lib/commonjs/nativeSdkVersions.js.map +1 -1
- package/lib/commonjs/types/AdshiftAdRevenue.js +0 -24
- package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -1
- package/lib/commonjs/types/AdshiftConfig.js +3 -24
- package/lib/commonjs/types/AdshiftConfig.js.map +1 -1
- package/lib/commonjs/types/AdshiftConsent.js +9 -45
- package/lib/commonjs/types/AdshiftConsent.js.map +1 -1
- package/lib/commonjs/types/AdshiftConsentSnapshot.js +5 -24
- package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -1
- package/lib/commonjs/types/AdshiftDeepLink.js +3 -30
- package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -1
- package/lib/commonjs/types/AdshiftError.js +7 -27
- package/lib/commonjs/types/AdshiftError.js.map +1 -1
- package/lib/commonjs/types/AdshiftEventParam.js +4 -38
- package/lib/commonjs/types/AdshiftEventParam.js.map +1 -1
- package/lib/commonjs/types/AdshiftEventType.js +1 -39
- package/lib/commonjs/types/AdshiftEventType.js.map +1 -1
- package/lib/commonjs/types/AdshiftThirdPartySharing.js +7 -38
- package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/Adshift.js +78 -285
- package/lib/module/Adshift.js.map +1 -1
- package/lib/module/NativeAdShiftReactNativePlugin.js +2 -12
- package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
- package/lib/module/index.js +1 -46
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest/index.js +4 -18
- package/lib/module/jest/index.js.map +1 -1
- package/lib/module/nativeSdkVersions.js +4 -6
- package/lib/module/nativeSdkVersions.js.map +1 -1
- package/lib/module/types/AdshiftAdRevenue.js +0 -24
- package/lib/module/types/AdshiftAdRevenue.js.map +1 -1
- package/lib/module/types/AdshiftConfig.js +3 -24
- package/lib/module/types/AdshiftConfig.js.map +1 -1
- package/lib/module/types/AdshiftConsent.js +9 -45
- package/lib/module/types/AdshiftConsent.js.map +1 -1
- package/lib/module/types/AdshiftConsentSnapshot.js +5 -24
- package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -1
- package/lib/module/types/AdshiftDeepLink.js +3 -31
- package/lib/module/types/AdshiftDeepLink.js.map +1 -1
- package/lib/module/types/AdshiftError.js +7 -28
- package/lib/module/types/AdshiftError.js.map +1 -1
- package/lib/module/types/AdshiftEventParam.js +4 -38
- package/lib/module/types/AdshiftEventParam.js.map +1 -1
- package/lib/module/types/AdshiftEventType.js +1 -39
- package/lib/module/types/AdshiftEventType.js.map +1 -1
- package/lib/module/types/AdshiftThirdPartySharing.js +7 -38
- package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/Adshift.d.ts +61 -185
- package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +10 -36
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -32
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/jest/index.d.ts +6 -20
- package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +4 -6
- package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +0 -24
- package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +10 -37
- package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +9 -49
- package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +10 -28
- package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +6 -34
- package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +7 -26
- package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +3 -19
- package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts +1 -23
- package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +7 -38
- package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/Adshift.d.ts +61 -185
- package/lib/typescript/module/src/Adshift.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +10 -36
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +0 -32
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/jest/index.d.ts +6 -20
- package/lib/typescript/module/src/jest/index.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeSdkVersions.d.ts +4 -6
- package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +0 -24
- package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftConfig.d.ts +10 -37
- package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftConsent.d.ts +9 -49
- package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +10 -28
- package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +6 -34
- package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftError.d.ts +7 -26
- package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +3 -19
- package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftEventType.d.ts +1 -23
- package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +7 -38
- package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +11 -1
- package/src/Adshift.ts +82 -286
- package/src/NativeAdShiftReactNativePlugin.ts +10 -48
- package/src/index.tsx +1 -44
- package/src/jest/index.ts +6 -20
- package/src/nativeSdkVersions.ts +4 -6
- package/src/types/AdshiftAdRevenue.ts +0 -24
- package/src/types/AdshiftConfig.ts +11 -54
- package/src/types/AdshiftConsent.ts +9 -49
- package/src/types/AdshiftConsentSnapshot.ts +11 -38
- package/src/types/AdshiftDeepLink.ts +6 -34
- package/src/types/AdshiftError.ts +7 -26
- package/src/types/AdshiftEventParam.ts +4 -38
- package/src/types/AdshiftEventType.ts +1 -39
- package/src/types/AdshiftThirdPartySharing.ts +7 -38
- package/src/version.ts +1 -1
- package/vendor/ios/AdshiftSDK.files.json +30 -0
- package/vendor/ios/AdshiftSDK.xcframework/Info.plist +44 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/AdshiftSDK +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +315 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Info.plist +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.abi.json +18729 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/Modules/module.modulemap +4 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/AdshiftSDK +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Headers/AdshiftSDK-Swift.h +626 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Info.plist +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +18729 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +18729 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/AdshiftSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +414 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/Modules/module.modulemap +4 -0
- package/vendor/ios/AdshiftSDK.xcframework/ios-arm64_x86_64-simulator/AdshiftSDK.framework/PrivacyInfo.xcprivacy +132 -0
- package/android/src/main/java/com/adshift/reactnativeplugin/RestoredIntents.kt +0 -64
|
@@ -1,53 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AdShift SDK for React Native.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import {
|
|
7
|
-
* Adshift,
|
|
8
|
-
* AdshiftEventParam,
|
|
9
|
-
* AdshiftEventType,
|
|
10
|
-
* } from '@adshift/react-native-plugin';
|
|
11
|
-
*
|
|
12
|
-
* // 1. Register the deep link listener (safe to do before initialize)
|
|
13
|
-
* const subscription = Adshift.onDeepLink((deepLink) => {
|
|
14
|
-
* // route on deepLink.deepLinkValue / deepLink.params
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* // 2. Initialize
|
|
18
|
-
* Adshift.initialize({ apiKey: 'your-api-key', isDebug: __DEV__ });
|
|
19
|
-
*
|
|
20
|
-
* // 3. Start
|
|
21
|
-
* const result = await Adshift.start();
|
|
22
|
-
*
|
|
23
|
-
* // 4. Track
|
|
24
|
-
* await Adshift.trackEvent(AdshiftEventType.Purchase, {
|
|
25
|
-
* [AdshiftEventParam.Revenue]: 9.99,
|
|
26
|
-
* [AdshiftEventParam.Currency]: 'USD',
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* // Later: subscription.remove();
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
1
|
import type { AdRevenueParams, AdshiftConfig, AdshiftConsent, AdshiftDeepLink, AdshiftEventTypeValue, AdshiftThirdPartySharing, ConsentSnapshot } from './types';
|
|
33
2
|
import { AdshiftErrorCode } from './types';
|
|
34
3
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* `
|
|
38
|
-
*
|
|
39
|
-
* at the time `start()` resolved, and `config.onError` reports
|
|
40
|
-
* `INVALID_API_KEY` when that verdict is `invalid`. On iOS the verdict usually
|
|
41
|
-
* arrives after `start()` resolved and is reported by the next `start()`; on
|
|
42
|
-
* Android `start()` waits up to 5 s for it.
|
|
4
|
+
* `success` says whether the SDK started on the device. The API key is checked
|
|
5
|
+
* in the background; an `invalid` verdict is also reported through
|
|
6
|
+
* `config.onError` as `INVALID_API_KEY`. Android waits up to 5 s for the
|
|
7
|
+
* verdict; on iOS it usually arrives later and shows in a later `start()`.
|
|
43
8
|
*/
|
|
44
9
|
export interface StartResult {
|
|
45
10
|
success: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Outcome of the API key check at the time `start()` resolved; `pending`
|
|
48
|
-
* means the answer had not arrived yet. It changes nothing you have to do:
|
|
49
|
-
* events tracked meanwhile stay queued on the device by the native SDK.
|
|
50
|
-
*/
|
|
11
|
+
/** The API key check when `start()` resolved; `pending` needs no action. */
|
|
51
12
|
apiKeyValidationStatus?: ApiKeyValidationStatus;
|
|
52
13
|
/** Platform error number behind `errorCode`, for support requests. */
|
|
53
14
|
nativeCode?: number | string;
|
|
@@ -61,11 +22,7 @@ export interface StartResult {
|
|
|
61
22
|
/** How far the API key check had got when `start()` resolved. */
|
|
62
23
|
export type ApiKeyValidationStatus = 'pending' | 'valid' | 'invalid';
|
|
63
24
|
export type EventValues = Record<string, string | number | boolean>;
|
|
64
|
-
/**
|
|
65
|
-
* Parameters for `Adshift.trackPurchase()`.
|
|
66
|
-
*/
|
|
67
25
|
export interface PurchaseParams {
|
|
68
|
-
/** Product identifier. */
|
|
69
26
|
productId: string;
|
|
70
27
|
/** Purchase amount in `currency`. */
|
|
71
28
|
revenue: number;
|
|
@@ -74,24 +31,15 @@ export interface PurchaseParams {
|
|
|
74
31
|
/** Transaction id or purchase token. */
|
|
75
32
|
transactionId: string;
|
|
76
33
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Subscription returned by `Adshift.onDeepLink()`.
|
|
79
|
-
*/
|
|
80
34
|
export interface DeepLinkSubscription {
|
|
81
|
-
/** Removes the listener
|
|
35
|
+
/** Removes the listener; safe to call more than once. */
|
|
82
36
|
remove(): void;
|
|
83
37
|
}
|
|
84
38
|
export type DeepLinkCallback = (deepLink: AdshiftDeepLink) => void;
|
|
85
|
-
/**
|
|
86
|
-
* Native SDK versions bundled with this plugin release.
|
|
87
|
-
*/
|
|
88
39
|
export interface NativeSdkVersions {
|
|
89
40
|
android: string;
|
|
90
41
|
ios: string;
|
|
91
42
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Plugin information returned by `Adshift.getInfo()`.
|
|
94
|
-
*/
|
|
95
43
|
export interface AdshiftInfo {
|
|
96
44
|
/** `Platform.OS`; the SDK only supports `ios` and `android`. */
|
|
97
45
|
platform: 'ios' | 'android' | (string & {});
|
|
@@ -102,33 +50,20 @@ export interface AdshiftInfo {
|
|
|
102
50
|
}
|
|
103
51
|
export declare const Adshift: {
|
|
104
52
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* The configuration is fixed on the first call; later calls are ignored.
|
|
109
|
-
*
|
|
110
|
-
* Never raises, because it is meant to run at module scope, where an error
|
|
111
|
-
* would stop the bundle from evaluating. An unusable config is reported
|
|
112
|
-
* through `config.onError` and answered by `start()`.
|
|
53
|
+
* Call once, as early as possible, for example at module scope. The first
|
|
54
|
+
* config is kept; later calls are ignored. Never raises: an unusable config
|
|
55
|
+
* is reported through `config.onError` and returned by `start()`.
|
|
113
56
|
*/
|
|
114
57
|
readonly initialize: (config: AdshiftConfig) => void;
|
|
115
58
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* `result.success` and `result.errorCode`. Calls to `trackEvent`,
|
|
120
|
-
* `trackPurchase` and `logAdRevenue` made before this resolves are queued
|
|
121
|
-
* and dispatched afterwards. A start that fails with a reason retrying
|
|
122
|
-
* cannot fix rejects them instead; any other failure keeps them waiting for
|
|
123
|
-
* the next attempt.
|
|
59
|
+
* Never rejects; check `result.success`. `trackEvent`, `trackPurchase` and
|
|
60
|
+
* `logAdRevenue` calls made before it succeeds wait for it. A failure that
|
|
61
|
+
* retrying cannot fix rejects them; otherwise they wait for the next try.
|
|
124
62
|
*/
|
|
125
63
|
readonly start: () => Promise<StartResult>;
|
|
126
64
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* Before `initialize()` there is nothing to stop: the call is reported and
|
|
131
|
-
* skipped.
|
|
65
|
+
* Tracking calls reject with `NOT_STARTED` until the next successful
|
|
66
|
+
* `start()`. Before `initialize()` the call is reported and skipped.
|
|
132
67
|
*/
|
|
133
68
|
readonly stop: () => void;
|
|
134
69
|
/**
|
|
@@ -137,99 +72,65 @@ export declare const Adshift: {
|
|
|
137
72
|
*/
|
|
138
73
|
readonly isStarted: () => boolean;
|
|
139
74
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
143
|
-
* An empty identifier is reported and skipped; nothing is raised.
|
|
75
|
+
* Your own user id; may be set at any time. Before `initialize()` it is kept
|
|
76
|
+
* and applied afterwards. An empty id is reported and skipped.
|
|
144
77
|
*/
|
|
145
78
|
readonly setCustomerUserId: (userId: string) => void;
|
|
146
79
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
80
|
+
* Verbose SDK logging. Before `initialize()` the value is kept and applied
|
|
81
|
+
* afterwards.
|
|
150
82
|
*/
|
|
151
83
|
readonly setDebugEnabled: (enabled: boolean) => void;
|
|
152
84
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* A negative interval is reported and skipped; nothing is raised.
|
|
85
|
+
* Debounce interval for automatic `app_open` events. Before `initialize()`
|
|
86
|
+
* the value is kept and applied afterwards. A negative value is reported and
|
|
87
|
+
* skipped.
|
|
157
88
|
*/
|
|
158
89
|
readonly setAppOpenDebounceMs: (ms: number) => void;
|
|
159
90
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* Called before `initialize()`, the domains are kept and applied with the
|
|
163
|
-
* config, so they are in place before the first link is processed.
|
|
91
|
+
* Your own link domains; set them before `start()`. Before `initialize()`
|
|
92
|
+
* they are kept and passed with the config.
|
|
164
93
|
*/
|
|
165
94
|
readonly setBrandedDomains: (domains: string[]) => void;
|
|
166
95
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
96
|
+
* Meta app id used to parse Meta App Links; no-op on iOS. Before
|
|
97
|
+
* `initialize()` the value is kept and applied afterwards.
|
|
170
98
|
*/
|
|
171
99
|
readonly setMetaAppId: (appId: string) => void;
|
|
172
100
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
101
|
+
* An OAID the app obtained itself, for Android devices without Google Play
|
|
102
|
+
* services; set `collectOaid: false` as well. No-op on iOS. Before
|
|
103
|
+
* `initialize()` the value is kept and applied afterwards.
|
|
178
104
|
*/
|
|
179
105
|
readonly setOaidData: (oaid: string) => void;
|
|
180
106
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* Called before `initialize()`, the consent is kept and applied afterwards.
|
|
107
|
+
* Consent collected by your own UI: `AdshiftConsent.forGDPRUser()` or
|
|
108
|
+
* `forNonGDPRUser()`. Before `initialize()` it is kept and applied later.
|
|
185
109
|
*/
|
|
186
110
|
readonly setConsentData: (consent: AdshiftConsent) => void;
|
|
187
111
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
112
|
+
* Reading IAB TCF v2.2 consent from the CMP on the device. Call before
|
|
113
|
+
* `start()`; before `initialize()` the value is kept and applied afterwards.
|
|
192
114
|
*/
|
|
193
115
|
readonly enableTCFDataCollection: (enabled: boolean) => void;
|
|
194
116
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* The GPP string rides on its own axis: it is forwarded alongside whatever
|
|
199
|
-
* decides the GDPR axis, including a consent set through `setConsentData()`,
|
|
200
|
-
* and it does not gate the advertising identifier on the device.
|
|
201
|
-
*
|
|
202
|
-
* Call before `start()`. Called before `initialize()`, the value is kept and
|
|
117
|
+
* Reading an IAB GPP string written by the CMP, for US state privacy
|
|
118
|
+
* signals; off until called with `true`. It does not gate the advertising
|
|
119
|
+
* id. Call before `start()`; before `initialize()` the value is kept and
|
|
203
120
|
* applied afterwards.
|
|
204
121
|
*/
|
|
205
122
|
readonly enableGPPDataCollection: (enabled: boolean) => void;
|
|
206
123
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* This is the answer to a different question than `setConsentData()`, and it
|
|
212
|
-
* has the opposite default: nothing said here means sharing is allowed, so
|
|
213
|
-
* only call it once the user has actually been asked. Setting `allowed()` at
|
|
214
|
-
* startup as a default records a declaration the user never made, and events
|
|
215
|
-
* already sent cannot be recalled when a real answer arrives.
|
|
216
|
-
*
|
|
217
|
-
* Nothing is gated on the device either way — this travels with the events for
|
|
218
|
-
* the backend to act on.
|
|
219
|
-
*
|
|
220
|
-
* Called before `initialize()`, the answer is kept and applied afterwards.
|
|
124
|
+
* The user's answer on sharing their data with advertising partners:
|
|
125
|
+
* `AdshiftThirdPartySharing.optedOut()` or `allowed()`. Unlike consent,
|
|
126
|
+
* saying nothing means allowed, so call it only once the user was asked;
|
|
127
|
+
* events already sent are not recalled. Kept if called before `initialize()`.
|
|
221
128
|
*/
|
|
222
129
|
readonly setThirdPartySharing: (sharing: AdshiftThirdPartySharing) => void;
|
|
223
130
|
/**
|
|
224
|
-
* Withdraws
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* stating that sharing is allowed: the first leaves the decision to your
|
|
228
|
-
* dashboard configuration, the second is the app's own declaration and is
|
|
229
|
-
* recorded as such.
|
|
230
|
-
*
|
|
231
|
-
* Called before `initialize()`, this cancels a `setThirdPartySharing()` that
|
|
232
|
-
* was also queued.
|
|
131
|
+
* Withdraws `setThirdPartySharing()`: later events say nothing about sharing,
|
|
132
|
+
* which is not the same as `allowed()`. Before `initialize()` it cancels a
|
|
133
|
+
* queued `setThirdPartySharing()`.
|
|
233
134
|
*/
|
|
234
135
|
readonly clearThirdPartySharing: () => void;
|
|
235
136
|
/**
|
|
@@ -240,45 +141,26 @@ export declare const Adshift: {
|
|
|
240
141
|
*/
|
|
241
142
|
readonly refreshConsent: () => Promise<ConsentSnapshot>;
|
|
242
143
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* `
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* Resolves once the SDK has accepted the event. A call made between
|
|
249
|
-
* `initialize()` and a successful `start()` waits for the start: it is sent
|
|
250
|
-
* when the SDK starts, and rejects when the start fails for a reason
|
|
251
|
-
* retrying cannot fix (rejected key, excluded device) or after `stop()`.
|
|
252
|
-
* A start that failed for any other reason keeps the call waiting for the
|
|
253
|
-
* next attempt, so `start()` belongs on every launch path.
|
|
254
|
-
*
|
|
144
|
+
* `app_install` and `app_open` are reserved. A call made before a successful
|
|
145
|
+
* `start()` waits for it, so call `start()` on every launch path; it rejects
|
|
146
|
+
* after `stop()` or a start failure retrying cannot fix (rejected key,
|
|
147
|
+
* excluded device).
|
|
255
148
|
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`, `NOT_STARTED`,
|
|
256
149
|
* `INVALID_API_KEY`, `OPTED_OUT`, `QUEUE_FULL`, `INVALID_ARGUMENT`).
|
|
257
150
|
*/
|
|
258
151
|
readonly trackEvent: (eventName: AdshiftEventTypeValue | (string & {}), values?: EventValues) => Promise<void>;
|
|
259
|
-
/**
|
|
260
|
-
* Tracks a purchase.
|
|
261
|
-
*
|
|
262
|
-
* @returns Rejects with `AdshiftError` (see `trackEvent`).
|
|
263
|
-
*/
|
|
152
|
+
/** Waits for `start()` and rejects like `trackEvent()`. */
|
|
264
153
|
readonly trackPurchase: (params: PurchaseParams) => Promise<void>;
|
|
265
154
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* @returns Rejects with `AdshiftError` (see `trackEvent`).
|
|
155
|
+
* Revenue of a single impression, not an aggregate. Waits for `start()` and
|
|
156
|
+
* rejects like `trackEvent()`.
|
|
269
157
|
*/
|
|
270
158
|
readonly logAdRevenue: (params: AdRevenueParams) => Promise<void>;
|
|
271
|
-
/**
|
|
272
|
-
* Returns the AdShift device id, or `null` before `initialize()`.
|
|
273
|
-
*/
|
|
159
|
+
/** `null` before `initialize()`. */
|
|
274
160
|
readonly getAdShiftDeviceId: () => Promise<string | null>;
|
|
275
161
|
/**
|
|
276
|
-
* Passes a URL to the SDK
|
|
277
|
-
*
|
|
278
|
-
* Not needed when `autoHandleDeepLinks` is on (the default). The result is
|
|
279
|
-
* delivered through `onDeepLink()`; the promise resolves once the SDK has
|
|
280
|
-
* finished processing the URL.
|
|
281
|
-
*
|
|
162
|
+
* Passes a URL to the SDK; not needed with `autoHandleDeepLinks` on (the
|
|
163
|
+
* default). The result arrives through `onDeepLink()`.
|
|
282
164
|
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
|
|
283
165
|
* `INVALID_ARGUMENT`).
|
|
284
166
|
*/
|
|
@@ -291,29 +173,23 @@ export declare const Adshift: {
|
|
|
291
173
|
*/
|
|
292
174
|
readonly handlePastedDeepLink: (url: string | null) => void;
|
|
293
175
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
* the SDK reads on its own, so register that key too if you still need it.
|
|
176
|
+
* A key path inside push payloads that carries an AdShift deep link. The
|
|
177
|
+
* first path replaces the top-level `as_push_link` the SDK reads by default,
|
|
178
|
+
* so add that one too if you still use it. Kept if called before
|
|
179
|
+
* `initialize()`.
|
|
299
180
|
*/
|
|
300
181
|
readonly addPushNotificationDeepLinkPath: (path: string[]) => void;
|
|
301
182
|
/**
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
* through `onDeepLink()`.
|
|
305
|
-
*
|
|
183
|
+
* Resolves to `true` when the payload carried an AdShift deep link; the
|
|
184
|
+
* result then arrives through `onDeepLink()`.
|
|
306
185
|
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
|
|
307
186
|
* `INVALID_ARGUMENT`).
|
|
308
187
|
*/
|
|
309
188
|
readonly handlePushNotification: (payload: Record<string, unknown>) => Promise<boolean>;
|
|
310
189
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* listener is registered are buffered and delivered to the first listener.
|
|
315
|
-
* Every link that reaches the SDK (direct, deferred, push) is delivered,
|
|
316
|
-
* each result once.
|
|
190
|
+
* Safe to call before `initialize()`. Results that arrive while no listener
|
|
191
|
+
* is registered are buffered for the first one. Every link that reaches the
|
|
192
|
+
* SDK (direct, deferred, push) is delivered once.
|
|
317
193
|
*/
|
|
318
194
|
readonly onDeepLink: (callback: DeepLinkCallback) => DeepLinkSubscription;
|
|
319
195
|
readonly getInfo: () => AdshiftInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Adshift.d.ts","sourceRoot":"","sources":["../../../../src/Adshift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Adshift.d.ts","sourceRoot":"","sources":["../../../../src/Adshift.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EAEf,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,gBAAgB,EAWjB,MAAM,SAAS,CAAC;AAGjB;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,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G;qCAEU,qBAAqB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,WACvC,WAAW,KACnB,OAAO,CAAC,IAAI,CAAC;IAwBhB,2DAA2D;qCACrC,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC;IAqCpD;;;OAGG;oCACkB,eAAe,KAAG,OAAO,CAAC,IAAI,CAAC;IAwFpD,oCAAoC;uCACR,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAYlD;;;;;OAKG;mCACuB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;IAyBhD;;;;;OAKG;yCACuB,MAAM,GAAG,IAAI,KAAG,IAAI;IAgB9C;;;;;OAKG;qDACmC,MAAM,EAAE,KAAG,IAAI;IAgBrD;;;;;OAKG;+CAEQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,OAAO,CAAC,OAAO,CAAC;IAkBnB;;;;OAIG;oCACkB,gBAAgB,KAAG,oBAAoB;4BAoBjD,WAAW;CAOd,CAAC;AAIX,eAAe,OAAO,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { TurboModule, CodegenTypes } from 'react-native';
|
|
2
|
-
/**
|
|
3
|
-
* Deep link result as emitted by the native module.
|
|
4
|
-
*
|
|
5
|
-
* Every field except `params`, `isDeferred` and `status` is optional.
|
|
6
|
-
* `params` is always present (possibly empty).
|
|
7
|
-
*/
|
|
8
2
|
export type NativeDeepLinkPayload = {
|
|
9
3
|
deepLink?: string;
|
|
10
4
|
deepLinkValue?: string;
|
|
@@ -25,30 +19,16 @@ export type NativeDeepLinkPayload = {
|
|
|
25
19
|
matchGuaranteed?: boolean;
|
|
26
20
|
};
|
|
27
21
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Complex inputs travel as `Object`; the JS layer (`Adshift.ts`) owns
|
|
31
|
-
* validation and typing. Results of deep link processing are delivered
|
|
32
|
-
* exclusively through `onDeepLink`.
|
|
22
|
+
* Complex inputs travel as `Object`, validated by `Adshift.ts`. Deep link
|
|
23
|
+
* results arrive only through `onDeepLink`.
|
|
33
24
|
*/
|
|
34
25
|
export interface Spec extends TurboModule {
|
|
35
|
-
/**
|
|
36
|
-
* Initializes the SDK.
|
|
37
|
-
*
|
|
38
|
-
* Config keys (all optional except `apiKey`): `apiKey`, `isDebug`,
|
|
39
|
-
* `appOpenDebounceMs`, `brandedDomains: string[]`, `testMode`,
|
|
40
|
-
* `metaAppId` (Android), `pushDeepLinkPaths: string[][]`,
|
|
41
|
-
* `autoHandleDeepLinks`, `disableSKAN` / `waitForATTBeforeStart` /
|
|
42
|
-
* `attTimeoutMs` / `deferredDeepLinkClipboard` (iOS), `collectOaid`
|
|
43
|
-
* (Android). Keys that are absent leave SDK defaults untouched.
|
|
44
|
-
*/
|
|
26
|
+
/** Config: `BRIDGED_KEYS` of `AdshiftConfig`; absent keys keep defaults. */
|
|
45
27
|
initialize(config: Object): void;
|
|
46
28
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* (`pending` | `valid` | `invalid`), `errorCode?: string`,
|
|
51
|
-
* `errorMessage?: string`, `nativeCode?: number | string`.
|
|
29
|
+
* Result keys: `success`, `apiKeyValidationStatus` (`pending` | `valid` |
|
|
30
|
+
* `invalid`); on failure `errorCode`, `errorMessage`, `nativeCode`. iOS adds
|
|
31
|
+
* `sdkVersion`, and `nativeDomain` on failure.
|
|
52
32
|
*/
|
|
53
33
|
start(): Promise<Object>;
|
|
54
34
|
/** Suspends delivery. Can be resumed with `start()`. */
|
|
@@ -73,7 +53,6 @@ export interface Spec extends TurboModule {
|
|
|
73
53
|
/** Sharing key: `optOut: boolean`. */
|
|
74
54
|
setThirdPartySharing(sharing: Object): void;
|
|
75
55
|
clearThirdPartySharing(): void;
|
|
76
|
-
/** Resolves to a consent snapshot object. */
|
|
77
56
|
refreshConsent(): Promise<Object>;
|
|
78
57
|
/** Resolves once the event has been accepted by the SDK queue. */
|
|
79
58
|
trackEvent(eventName: string, values: Object | null): Promise<void>;
|
|
@@ -83,16 +62,12 @@ export interface Spec extends TurboModule {
|
|
|
83
62
|
* `revenue`, optional `adUnitId`, `precision`, `additionalParameters`.
|
|
84
63
|
*/
|
|
85
64
|
logAdRevenue(data: Object): Promise<void>;
|
|
86
|
-
/**
|
|
65
|
+
/** `null` before initialization. */
|
|
87
66
|
getAdShiftDeviceId(): Promise<string | null>;
|
|
88
67
|
/**
|
|
89
|
-
*
|
|
90
|
-
* the
|
|
91
|
-
*
|
|
92
|
-
* `fromLaunch` marks the URL that opened the app, as opposed to one opened
|
|
93
|
-
* while the app was running. Launch URLs are remembered for the lifetime of
|
|
94
|
-
* the process, so reloading JavaScript cannot book the same link twice,
|
|
95
|
-
* while a genuine second tap on the same link is still forwarded.
|
|
68
|
+
* The result arrives through `onDeepLink`. `fromLaunch` marks the URL that
|
|
69
|
+
* opened the app; such a URL is forwarded once per process, so a JavaScript
|
|
70
|
+
* reload cannot count it twice.
|
|
96
71
|
*/
|
|
97
72
|
handleDeepLink(url: string, fromLaunch: boolean): Promise<void>;
|
|
98
73
|
/**
|
|
@@ -100,7 +75,6 @@ export interface Spec extends TurboModule {
|
|
|
100
75
|
* skipped it. iOS only; no-op on Android.
|
|
101
76
|
*/
|
|
102
77
|
handlePastedDeepLink(url: string | null): void;
|
|
103
|
-
/** Registers a push payload key path that carries a deep link. */
|
|
104
78
|
addPushNotificationDeepLinkPath(path: string[]): void;
|
|
105
79
|
/** Resolves to true when the payload was recognised as an AdShift push. */
|
|
106
80
|
handlePushNotification(payload: Object): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdShiftReactNativePlugin.d.ts","sourceRoot":"","sources":["../../../../src/NativeAdShiftReactNativePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG9D
|
|
1
|
+
{"version":3,"file":"NativeAdShiftReactNativePlugin.d.ts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AAC,OAAO,CAAC,CAAC;IAE1D,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;CACvE;;AAED,wBAEE"}
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AdShift React Native Plugin
|
|
3
|
-
*
|
|
4
|
-
* Mobile attribution, event tracking, SKAdNetwork, deep linking and
|
|
5
|
-
* GDPR/TCF 2.2 consent.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import {
|
|
10
|
-
* Adshift,
|
|
11
|
-
* AdshiftEventParam,
|
|
12
|
-
* AdshiftEventType,
|
|
13
|
-
* AdshiftConsent,
|
|
14
|
-
* AdshiftDeepLinkStatus,
|
|
15
|
-
* } from '@adshift/react-native-plugin';
|
|
16
|
-
*
|
|
17
|
-
* Adshift.onDeepLink((deepLink) => {
|
|
18
|
-
* if (deepLink.status === AdshiftDeepLinkStatus.Found) {
|
|
19
|
-
* // route on deepLink.deepLinkValue / deepLink.params
|
|
20
|
-
* }
|
|
21
|
-
* });
|
|
22
|
-
*
|
|
23
|
-
* Adshift.initialize({ apiKey: 'your-api-key', isDebug: __DEV__ });
|
|
24
|
-
* await Adshift.start();
|
|
25
|
-
* await Adshift.trackEvent(AdshiftEventType.Purchase, {
|
|
26
|
-
* [AdshiftEventParam.Revenue]: 9.99,
|
|
27
|
-
* [AdshiftEventParam.Currency]: 'USD',
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @packageDocumentation
|
|
32
|
-
*/
|
|
33
1
|
export { Adshift, default } from './Adshift';
|
|
34
2
|
export type { StartResult, EventValues, PurchaseParams, DeepLinkSubscription, DeepLinkCallback, NativeSdkVersions, AdshiftInfo, } from './Adshift';
|
|
35
3
|
export type { AdshiftConfig, AdshiftDeferredDeepLinkClipboard } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,YAAY,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,aAAa,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EACV,cAAc,IAAI,kBAAkB,EACpC,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,YAAY,EAAE,wBAAwB,IAAI,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAExF,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Jest
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* ```js
|
|
8
|
-
* // jest.setup.js
|
|
9
|
-
* jest.mock('@adshift/react-native-plugin', () =>
|
|
10
|
-
* require('@adshift/react-native-plugin/jest').createAdshiftMock()
|
|
11
|
-
* );
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Every method is a `jest.fn()` with a resolved default so tests can assert
|
|
15
|
-
* calls or override behaviour per test.
|
|
2
|
+
* Jest mock of the package, whose native module fails to load in plain Jest.
|
|
3
|
+
* In your Jest setup file: `jest.mock('@adshift/react-native-plugin', () =>
|
|
4
|
+
* require('@adshift/react-native-plugin/jest').createAdshiftMock());`
|
|
5
|
+
* Every method is a `jest.fn()` with a default answer.
|
|
16
6
|
*/
|
|
17
7
|
import type { AdshiftConfig } from '../types/AdshiftConfig';
|
|
18
8
|
import type { AdshiftConsent as AdshiftConsentType } from '../types/AdshiftConsent';
|
|
@@ -27,9 +17,6 @@ import { AdshiftMediationNetwork } from '../types/AdshiftAdRevenue';
|
|
|
27
17
|
import { AdshiftErrorCode, createAdshiftError, isAdshiftError } from '../types/AdshiftError';
|
|
28
18
|
type MockFn<T extends (...args: never[]) => unknown> = jest.Mock<ReturnType<T>, Parameters<T>>;
|
|
29
19
|
type Listener = (deepLink: AdshiftDeepLinkType) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Mocked `Adshift` object with test helpers.
|
|
32
|
-
*/
|
|
33
20
|
export interface AdshiftMock {
|
|
34
21
|
initialize: MockFn<(config: AdshiftConfig) => void>;
|
|
35
22
|
start: MockFn<() => Promise<{
|
|
@@ -71,9 +58,8 @@ export interface AdshiftMock {
|
|
|
71
58
|
/** Test helper: delivers a deep link to every registered listener. */
|
|
72
59
|
__emitDeepLink(deepLink: AdshiftDeepLinkType): void;
|
|
73
60
|
/**
|
|
74
|
-
* Test helper: returns the mock to
|
|
75
|
-
*
|
|
76
|
-
* behaviour dropped, default answers back in place.
|
|
61
|
+
* Test helper: returns the mock to its state at creation: no listeners, not
|
|
62
|
+
* started, recorded calls and per-test overrides dropped, defaults restored.
|
|
77
63
|
*/
|
|
78
64
|
__reset(): void;
|
|
79
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/jest/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/jest/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,IAAI,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAClH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAG/B,KAAK,MAAM,CAAC,CAA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
-
* Kept in its own module so the Jest mock can report the same values without
|
|
5
|
-
* loading the native module, and so a release bumps them in one place.
|
|
2
|
+
* Native SDK versions this plugin is pinned to; a module of their own so the
|
|
3
|
+
* Jest mock can report them without loading the native module.
|
|
6
4
|
*/
|
|
7
5
|
export declare const NATIVE_SDK_VERSIONS: Readonly<{
|
|
8
|
-
android: "4.
|
|
9
|
-
ios: "3.
|
|
6
|
+
android: "4.2.0";
|
|
7
|
+
ios: "3.1.0";
|
|
10
8
|
}>;
|
|
11
9
|
//# sourceMappingURL=nativeSdkVersions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeSdkVersions.d.ts","sourceRoot":"","sources":["../../../../src/nativeSdkVersions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"nativeSdkVersions.d.ts","sourceRoot":"","sources":["../../../../src/nativeSdkVersions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC"}
|