@adshift/react-native-plugin 2.1.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdShiftReactNativePlugin.podspec +20 -4
- package/CHANGELOG.md +57 -8
- package/README.md +131 -74
- package/android/build.gradle +3 -2
- package/android/consumer-rules.pro +2 -21
- package/android/src/main/AndroidManifest.xml +14 -1
- package/android/src/main/java/com/adshift/reactnativeplugin/ActivityIntents.kt +307 -0
- package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +90 -153
- package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +0 -20
- package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +40 -7
- package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +51 -5
- package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +0 -5
- package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +21 -11
- package/android/src/test/java/com/adshift/reactnativeplugin/LaunchLinkRecordTest.kt +420 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +97 -25
- package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +0 -4
- package/ios/AdShiftReactNativePlugin.h +0 -12
- package/ios/AdShiftReactNativePlugin.mm +7 -14
- package/ios/AdShiftReactNativePluginHelper.swift +38 -73
- package/ios/Core/BridgeRules.swift +42 -30
- package/lib/commonjs/Adshift.js +100 -284
- 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 +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/jest/index.js +6 -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 +11 -23
- 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 +50 -33
- 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/types/index.js +12 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/Adshift.js +101 -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 +2 -47
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest/index.js +7 -19
- 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 +10 -23
- 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 +49 -32
- 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/types/index.js +2 -2
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/Adshift.d.ts +68 -184
- package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +18 -35
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -34
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/jest/index.d.ts +9 -21
- 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 +35 -39
- 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 +55 -39
- 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/types/index.d.ts +3 -3
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/Adshift.d.ts +68 -184
- package/lib/typescript/module/src/Adshift.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +18 -35
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -34
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/jest/index.d.ts +9 -21
- 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 +35 -39
- 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 +55 -39
- 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/types/index.d.ts +3 -3
- package/lib/typescript/module/src/types/index.d.ts.map +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +11 -1
- package/src/Adshift.ts +118 -285
- package/src/NativeAdShiftReactNativePlugin.ts +19 -47
- package/src/index.tsx +7 -46
- package/src/jest/index.ts +11 -20
- package/src/nativeSdkVersions.ts +4 -6
- package/src/types/AdshiftAdRevenue.ts +0 -24
- package/src/types/AdshiftConfig.ts +48 -55
- package/src/types/AdshiftConsent.ts +9 -49
- package/src/types/AdshiftConsentSnapshot.ts +11 -38
- package/src/types/AdshiftDeepLink.ts +87 -39
- 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/types/index.ts +9 -2
- 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
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Predefined event types for AdShift SDK.
|
|
3
|
-
*
|
|
4
|
-
* Use these constants for consistent event naming across your app.
|
|
5
|
-
*
|
|
6
|
-
* Pair them with `AdshiftEventParam` for the values.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* await Adshift.trackEvent(AdshiftEventType.AddToCart, {
|
|
11
|
-
* [AdshiftEventParam.ContentId]: 'SKU123',
|
|
12
|
-
* [AdshiftEventParam.Price]: 29.99,
|
|
13
|
-
* });
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* You can also use custom event names as strings:
|
|
17
|
-
* ```typescript
|
|
18
|
-
* await Adshift.trackEvent('custom_event_name');
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
1
|
+
/** Standard event names; any other name is tracked as a custom event. */
|
|
21
2
|
export declare const AdshiftEventType: {
|
|
22
3
|
readonly AddToCart: "as_add_to_cart";
|
|
23
4
|
readonly AddToWishList: "as_add_to_wishlist";
|
|
@@ -57,8 +38,5 @@ export declare const AdshiftEventType: {
|
|
|
57
38
|
readonly CustomerSegment: "as_customer_segment";
|
|
58
39
|
};
|
|
59
40
|
export type AdshiftEventTypeValue = (typeof AdshiftEventType)[keyof typeof AdshiftEventType];
|
|
60
|
-
/**
|
|
61
|
-
* Returns all predefined event types as an array.
|
|
62
|
-
*/
|
|
63
41
|
export declare function getAllEventTypes(): AdshiftEventTypeValue[];
|
|
64
42
|
//# sourceMappingURL=AdshiftEventType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdshiftEventType.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventType.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AdshiftEventType.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventType.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;IA+B3B,2EAA2E;;;;;;;;;;;IAqB3E,8DAA8D;;IAG9D,6DAA6D;;IAG7D,yEAAyE;;IAGzE,2EAA2E;;IAG3E,2DAA2D;;CAEnD,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,wBAAgB,gBAAgB,IAAI,qBAAqB,EAAE,CAE1D"}
|
|
@@ -1,53 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* default. Consent under GDPR must be affirmative, so a flag nobody set counts
|
|
6
|
-
* as no consent. Here nothing said means sharing is allowed — which is why this
|
|
7
|
-
* is not a fourth flag on the consent object: folding the two together would
|
|
8
|
-
* make one of them wrong.
|
|
9
|
-
*
|
|
10
|
-
* The three states live in the calls rather than in a nullable field. Never
|
|
11
|
-
* calling `Adshift.setThirdPartySharing()` leaves the question unanswered,
|
|
12
|
-
* `Adshift.clearThirdPartySharing()` returns to unanswered, and the value here
|
|
13
|
-
* is the answer itself.
|
|
14
|
-
*
|
|
15
|
-
* An object rather than a bare `boolean` so a field can be added later without
|
|
16
|
-
* breaking callers.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* // The user asked not to have their data passed on
|
|
21
|
-
* Adshift.setThirdPartySharing(AdshiftThirdPartySharing.optedOut());
|
|
22
|
-
*
|
|
23
|
-
* // The user was asked and did not opt out
|
|
24
|
-
* Adshift.setThirdPartySharing(AdshiftThirdPartySharing.allowed());
|
|
25
|
-
* ```
|
|
2
|
+
* The user's answer on passing their data on to advertising partners. Unlike
|
|
3
|
+
* consent, no answer means allowed. Until `Adshift.setThirdPartySharing()` is
|
|
4
|
+
* called, or after `clearThirdPartySharing()`, the question is unanswered.
|
|
26
5
|
*/
|
|
27
6
|
export interface AdshiftThirdPartySharing {
|
|
28
7
|
/** `true` withholds this user's data from advertising partners. */
|
|
29
8
|
optOut: boolean;
|
|
30
9
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Helper functions for creating `AdshiftThirdPartySharing` objects.
|
|
33
|
-
*/
|
|
10
|
+
/** Builds `AdshiftThirdPartySharing` values. */
|
|
34
11
|
export declare const AdshiftThirdPartySharing: {
|
|
35
12
|
/** The user asked not to have their data passed on. */
|
|
36
13
|
optedOut(): AdshiftThirdPartySharing;
|
|
37
14
|
/**
|
|
38
|
-
* The user did not
|
|
39
|
-
*
|
|
40
|
-
* Only worth sending when the app has actually asked. Setting this at startup
|
|
41
|
-
* as a default is the one mistake to avoid here: a CMP answer arriving later
|
|
42
|
-
* cannot be undone for events already sent, and the declaration is recorded
|
|
43
|
-
* as the app's own rather than as the absence of one.
|
|
15
|
+
* The user was asked and did not opt out. Not a default for startup: a later
|
|
16
|
+
* answer cannot correct events already sent.
|
|
44
17
|
*/
|
|
45
18
|
allowed(): AdshiftThirdPartySharing;
|
|
46
19
|
};
|
|
47
|
-
/**
|
|
48
|
-
* Converts `AdshiftThirdPartySharing` to a plain object for the native bridge.
|
|
49
|
-
*
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
20
|
+
/** @internal */
|
|
52
21
|
export declare function thirdPartySharingToMap(sharing: AdshiftThirdPartySharing): Record<string, boolean>;
|
|
53
22
|
//# sourceMappingURL=AdshiftThirdPartySharing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdshiftThirdPartySharing.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftThirdPartySharing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AdshiftThirdPartySharing.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftThirdPartySharing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,gDAAgD;AAChD,eAAO,MAAM,wBAAwB;IACnC,uDAAuD;gBAC3C,wBAAwB;IAIpC;;;OAGG;eACQ,wBAAwB;CAGpC,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type { AdshiftConfig } from './AdshiftConfig';
|
|
2
|
-
export { configToMap } from './AdshiftConfig';
|
|
1
|
+
export type { AdshiftConfig, AdshiftDeferredDeepLinkClipboard, } from './AdshiftConfig';
|
|
2
|
+
export { configToMap, DEFERRED_DEEP_LINK_CLIPBOARD_MODES, } from './AdshiftConfig';
|
|
3
3
|
export type { ConsentFlag } from './AdshiftConsent';
|
|
4
4
|
export { AdshiftConsent, consentToMap } from './AdshiftConsent';
|
|
5
5
|
export type { ConsentSnapshot, ConsentSource } from './AdshiftConsentSnapshot';
|
|
6
6
|
export { consentSnapshotFromMap } from './AdshiftConsentSnapshot';
|
|
7
7
|
export { AdshiftThirdPartySharing, thirdPartySharingToMap, } from './AdshiftThirdPartySharing';
|
|
8
|
-
export { AdshiftDeepLinkStatus, AdshiftDeepLink, deepLinkToMap, } from './AdshiftDeepLink';
|
|
8
|
+
export { AdshiftDeepLinkStatus, AdshiftDeepLinkSource, AdshiftDeepLink, deepLinkToMap, } from './AdshiftDeepLink';
|
|
9
9
|
export { AdshiftEventType, getAllEventTypes } from './AdshiftEventType';
|
|
10
10
|
export type { AdshiftEventTypeValue } from './AdshiftEventType';
|
|
11
11
|
export { AdshiftEventParam, getAllEventParams } from './AdshiftEventParam';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,gCAAgC,GACjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,WAAW,EACX,kCAAkC,GACnC,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,YAAY,EACV,4BAA4B,EAC5B,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "
|
|
1
|
+
export declare const PLUGIN_VERSION = "3.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -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,72 +141,55 @@ 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
|
*/
|
|
285
167
|
readonly handleDeepLink: (url: string) => Promise<void>;
|
|
286
168
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
|
|
169
|
+
* With `deferredDeepLinkClipboard: 'pasteControl'`, passes what the user
|
|
170
|
+
* pasted with `UIPasteControl`, or `null` when they skipped it. Call it on
|
|
171
|
+
* every way out of onboarding: the first launch's deferred deep link waits
|
|
172
|
+
* for it. No-op on Android.
|
|
173
|
+
*/
|
|
174
|
+
readonly handlePastedDeepLink: (url: string | null) => void;
|
|
175
|
+
/**
|
|
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()`.
|
|
292
180
|
*/
|
|
293
181
|
readonly addPushNotificationDeepLinkPath: (path: string[]) => void;
|
|
294
182
|
/**
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
* through `onDeepLink()`.
|
|
298
|
-
*
|
|
183
|
+
* Resolves to `true` when the payload carried an AdShift deep link; the
|
|
184
|
+
* result then arrives through `onDeepLink()`.
|
|
299
185
|
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
|
|
300
186
|
* `INVALID_ARGUMENT`).
|
|
301
187
|
*/
|
|
302
188
|
readonly handlePushNotification: (payload: Record<string, unknown>) => Promise<boolean>;
|
|
303
189
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* listener is registered are buffered and delivered to the first listener.
|
|
308
|
-
* Every link that reaches the SDK (direct, deferred, push) is delivered.
|
|
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.
|
|
309
193
|
*/
|
|
310
194
|
readonly onDeepLink: (callback: DeepLinkCallback) => DeepLinkSubscription;
|
|
311
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":"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"}
|
|
@@ -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;
|
|
@@ -20,31 +14,21 @@ export type NativeDeepLinkPayload = {
|
|
|
20
14
|
deepLinkSub4?: string;
|
|
21
15
|
deepLinkSub5?: string;
|
|
22
16
|
isFirstSession?: boolean;
|
|
17
|
+
source?: string;
|
|
18
|
+
clickId?: string;
|
|
19
|
+
matchGuaranteed?: boolean;
|
|
23
20
|
};
|
|
24
21
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Complex inputs travel as `Object`; the JS layer (`Adshift.ts`) owns
|
|
28
|
-
* validation and typing. Results of deep link processing are delivered
|
|
29
|
-
* exclusively through `onDeepLink`.
|
|
22
|
+
* Complex inputs travel as `Object`, validated by `Adshift.ts`. Deep link
|
|
23
|
+
* results arrive only through `onDeepLink`.
|
|
30
24
|
*/
|
|
31
25
|
export interface Spec extends TurboModule {
|
|
32
|
-
/**
|
|
33
|
-
* Initializes the SDK.
|
|
34
|
-
*
|
|
35
|
-
* Config keys (all optional except `apiKey`): `apiKey`, `isDebug`,
|
|
36
|
-
* `appOpenDebounceMs`, `brandedDomains: string[]`, `metaAppId` (Android),
|
|
37
|
-
* `pushDeepLinkPaths: string[][]`, `autoHandleDeepLinks`,
|
|
38
|
-
* `disableSKAN` / `waitForATTBeforeStart` / `attTimeoutMs` (iOS),
|
|
39
|
-
* `collectOaid` (Android). Keys that are absent leave SDK defaults untouched.
|
|
40
|
-
*/
|
|
26
|
+
/** Config: `BRIDGED_KEYS` of `AdshiftConfig`; absent keys keep defaults. */
|
|
41
27
|
initialize(config: Object): void;
|
|
42
28
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* (`pending` | `valid` | `invalid`), `errorCode?: string`,
|
|
47
|
-
* `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.
|
|
48
32
|
*/
|
|
49
33
|
start(): Promise<Object>;
|
|
50
34
|
/** Suspends delivery. Can be resumed with `start()`. */
|
|
@@ -69,7 +53,6 @@ export interface Spec extends TurboModule {
|
|
|
69
53
|
/** Sharing key: `optOut: boolean`. */
|
|
70
54
|
setThirdPartySharing(sharing: Object): void;
|
|
71
55
|
clearThirdPartySharing(): void;
|
|
72
|
-
/** Resolves to a consent snapshot object. */
|
|
73
56
|
refreshConsent(): Promise<Object>;
|
|
74
57
|
/** Resolves once the event has been accepted by the SDK queue. */
|
|
75
58
|
trackEvent(eventName: string, values: Object | null): Promise<void>;
|
|
@@ -79,19 +62,19 @@ export interface Spec extends TurboModule {
|
|
|
79
62
|
* `revenue`, optional `adUnitId`, `precision`, `additionalParameters`.
|
|
80
63
|
*/
|
|
81
64
|
logAdRevenue(data: Object): Promise<void>;
|
|
82
|
-
/**
|
|
65
|
+
/** `null` before initialization. */
|
|
83
66
|
getAdShiftDeviceId(): Promise<string | null>;
|
|
84
67
|
/**
|
|
85
|
-
*
|
|
86
|
-
* the
|
|
87
|
-
*
|
|
88
|
-
* `fromLaunch` marks the URL that opened the app, as opposed to one opened
|
|
89
|
-
* while the app was running. Launch URLs are remembered for the lifetime of
|
|
90
|
-
* the process, so reloading JavaScript cannot book the same link twice,
|
|
91
|
-
* 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.
|
|
92
71
|
*/
|
|
93
72
|
handleDeepLink(url: string, fromLaunch: boolean): Promise<void>;
|
|
94
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Passes what the user pasted with `UIPasteControl`, or null when they
|
|
75
|
+
* skipped it. iOS only; no-op on Android.
|
|
76
|
+
*/
|
|
77
|
+
handlePastedDeepLink(url: string | null): void;
|
|
95
78
|
addPushNotificationDeepLinkPath(path: string[]): void;
|
|
96
79
|
/** Resolves to true when the payload was recognised as an AdShift push. */
|
|
97
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","sourceRoot":"","sources":["../../../../src/NativeAdShiftReactNativePlugin.ts"],"names":[],"mappings":"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"}
|