@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.
- package/AdShiftReactNativePlugin.podspec +11 -7
- package/CHANGELOG.md +122 -0
- package/README.md +506 -542
- package/android/build.gradle +17 -3
- package/android/consumer-rules.pro +21 -0
- package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +786 -229
- package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +180 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +146 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +111 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +168 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +106 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +167 -0
- package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +164 -0
- package/ios/AdShiftReactNativePlugin.h +7 -7
- package/ios/AdShiftReactNativePlugin.mm +200 -181
- package/ios/AdShiftReactNativePluginHelper.swift +584 -286
- package/ios/Core/BridgeRules.swift +82 -0
- package/lib/commonjs/Adshift.js +1135 -0
- package/lib/commonjs/Adshift.js.map +1 -0
- package/lib/commonjs/NativeAdShiftReactNativePlugin.js +22 -0
- package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -0
- package/lib/commonjs/index.js +94 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/jest/index.js +164 -0
- package/lib/commonjs/jest/index.js.map +1 -0
- package/lib/commonjs/nativeSdkVersions.js +17 -0
- package/lib/commonjs/nativeSdkVersions.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types/AdshiftAdRevenue.js +47 -0
- package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -0
- package/lib/commonjs/types/AdshiftConfig.js +45 -0
- package/lib/commonjs/types/AdshiftConfig.js.map +1 -0
- package/lib/commonjs/types/AdshiftConsent.js +113 -0
- package/lib/commonjs/types/AdshiftConsent.js.map +1 -0
- package/lib/commonjs/types/AdshiftConsentSnapshot.js +69 -0
- package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -0
- package/lib/commonjs/types/AdshiftDeepLink.js +154 -0
- package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -0
- package/lib/commonjs/types/AdshiftError.js +91 -0
- package/lib/commonjs/types/AdshiftError.js.map +1 -0
- package/lib/commonjs/types/AdshiftEventParam.js +140 -0
- package/lib/commonjs/types/AdshiftEventParam.js.map +1 -0
- package/lib/commonjs/types/AdshiftEventType.js +88 -0
- package/lib/commonjs/types/AdshiftEventType.js.map +1 -0
- package/lib/commonjs/types/AdshiftThirdPartySharing.js +70 -0
- package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -0
- package/lib/commonjs/types/index.js +123 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/version.js +9 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/Adshift.js +959 -296
- package/lib/module/Adshift.js.map +1 -1
- package/lib/module/NativeAdShiftReactNativePlugin.js +10 -7
- package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
- package/lib/module/index.js +26 -25
- package/lib/module/index.js.map +1 -1
- package/lib/module/jest/index.js +144 -0
- package/lib/module/jest/index.js.map +1 -0
- package/lib/module/nativeSdkVersions.js +13 -0
- package/lib/module/nativeSdkVersions.js.map +1 -0
- package/lib/module/types/AdshiftAdRevenue.js +43 -0
- package/lib/module/types/AdshiftAdRevenue.js.map +1 -0
- package/lib/module/types/AdshiftConfig.js +23 -26
- package/lib/module/types/AdshiftConfig.js.map +1 -1
- package/lib/module/types/AdshiftConsent.js +57 -50
- package/lib/module/types/AdshiftConsent.js.map +1 -1
- package/lib/module/types/AdshiftConsentSnapshot.js +65 -0
- package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -0
- package/lib/module/types/AdshiftDeepLink.js +97 -67
- package/lib/module/types/AdshiftDeepLink.js.map +1 -1
- package/lib/module/types/AdshiftError.js +87 -0
- package/lib/module/types/AdshiftError.js.map +1 -0
- package/lib/module/types/AdshiftEventParam.js +135 -0
- package/lib/module/types/AdshiftEventParam.js.map +1 -0
- package/lib/module/types/AdshiftEventType.js +11 -36
- package/lib/module/types/AdshiftEventType.js.map +1 -1
- package/lib/module/types/AdshiftThirdPartySharing.js +65 -0
- package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -0
- package/lib/module/types/index.js +9 -7
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/version.js +5 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/Adshift.d.ts +311 -0
- package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
- package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +51 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/jest/index.d.ts +103 -0
- package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +11 -0
- package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +56 -0
- package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +104 -0
- package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +76 -0
- package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +56 -0
- package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +89 -0
- package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +57 -0
- package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +111 -0
- package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/types/AdshiftEventType.d.ts +12 -35
- package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +53 -0
- package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/index.d.ts +17 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +2 -0
- package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
- package/lib/typescript/module/src/Adshift.d.ts +311 -0
- package/lib/typescript/module/src/Adshift.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
- package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +51 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/jest/index.d.ts +103 -0
- package/lib/typescript/module/src/jest/index.d.ts.map +1 -0
- package/lib/typescript/module/src/nativeSdkVersions.d.ts +11 -0
- package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +56 -0
- package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftConfig.d.ts +104 -0
- package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftConsent.d.ts +76 -0
- package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +56 -0
- package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +89 -0
- package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftError.d.ts +57 -0
- package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +111 -0
- package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftEventType.d.ts +64 -0
- package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -0
- package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +53 -0
- package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
- package/lib/typescript/module/src/types/index.d.ts +17 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +2 -0
- package/lib/typescript/module/src/version.d.ts.map +1 -0
- package/package.json +49 -10
- package/src/Adshift.ts +1273 -342
- package/src/NativeAdShiftReactNativePlugin.ts +81 -115
- package/src/index.tsx +40 -25
- package/src/jest/index.ts +224 -0
- package/src/nativeSdkVersions.ts +10 -0
- package/src/types/AdshiftAdRevenue.ts +58 -0
- package/src/types/AdshiftConfig.ts +101 -53
- package/src/types/AdshiftConsent.ts +75 -72
- package/src/types/AdshiftConsentSnapshot.ts +103 -0
- package/src/types/AdshiftDeepLink.ts +123 -102
- package/src/types/AdshiftError.ts +107 -0
- package/src/types/AdshiftEventParam.ts +216 -0
- package/src/types/AdshiftEventType.ts +13 -35
- package/src/types/AdshiftThirdPartySharing.ts +63 -0
- package/src/types/index.ts +38 -6
- package/src/version.ts +2 -0
- package/lib/typescript/src/Adshift.d.ts +0 -335
- package/lib/typescript/src/Adshift.d.ts.map +0 -1
- package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts +0 -143
- package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -47
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/types/AdshiftConfig.d.ts +0 -74
- package/lib/typescript/src/types/AdshiftConfig.d.ts.map +0 -1
- package/lib/typescript/src/types/AdshiftConsent.d.ts +0 -88
- package/lib/typescript/src/types/AdshiftConsent.d.ts.map +0 -1
- package/lib/typescript/src/types/AdshiftDeepLink.d.ts +0 -93
- package/lib/typescript/src/types/AdshiftDeepLink.d.ts.map +0 -1
- package/lib/typescript/src/types/AdshiftEventType.d.ts.map +0 -1
- package/lib/typescript/src/types/index.d.ts +0 -5
- package/lib/typescript/src/types/index.d.ts.map +0 -1
- /package/lib/typescript/{package.json → module/package.json} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the app says about passing this user's data on to someone else.
|
|
3
|
+
*
|
|
4
|
+
* A separate question from {@link AdshiftConsent}, and one with the opposite
|
|
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
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export interface AdshiftThirdPartySharing {
|
|
28
|
+
/** `true` withholds this user's data from advertising partners. */
|
|
29
|
+
optOut: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Helper functions for creating `AdshiftThirdPartySharing` objects.
|
|
33
|
+
*/
|
|
34
|
+
export declare const AdshiftThirdPartySharing: {
|
|
35
|
+
/** The user asked not to have their data passed on. */
|
|
36
|
+
optedOut(): AdshiftThirdPartySharing;
|
|
37
|
+
/**
|
|
38
|
+
* The user did not ask to be excluded.
|
|
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.
|
|
44
|
+
*/
|
|
45
|
+
allowed(): AdshiftThirdPartySharing;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Converts `AdshiftThirdPartySharing` to a plain object for the native bridge.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare function thirdPartySharingToMap(sharing: AdshiftThirdPartySharing): Record<string, boolean>;
|
|
53
|
+
//# sourceMappingURL=AdshiftThirdPartySharing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftThirdPartySharing.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftThirdPartySharing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB;IACnC,uDAAuD;gBAC3C,wBAAwB;IAIpC;;;;;;;OAOG;eACQ,wBAAwB;CAGpC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { AdshiftConfig } from './AdshiftConfig';
|
|
2
|
+
export { configToMap } from './AdshiftConfig';
|
|
3
|
+
export type { ConsentFlag } from './AdshiftConsent';
|
|
4
|
+
export { AdshiftConsent, consentToMap } from './AdshiftConsent';
|
|
5
|
+
export type { ConsentSnapshot, ConsentSource } from './AdshiftConsentSnapshot';
|
|
6
|
+
export { consentSnapshotFromMap } from './AdshiftConsentSnapshot';
|
|
7
|
+
export { AdshiftThirdPartySharing, thirdPartySharingToMap, } from './AdshiftThirdPartySharing';
|
|
8
|
+
export { AdshiftDeepLinkStatus, AdshiftDeepLink, deepLinkToMap, } from './AdshiftDeepLink';
|
|
9
|
+
export { AdshiftEventType, getAllEventTypes } from './AdshiftEventType';
|
|
10
|
+
export type { AdshiftEventTypeValue } from './AdshiftEventType';
|
|
11
|
+
export { AdshiftEventParam, getAllEventParams } from './AdshiftEventParam';
|
|
12
|
+
export type { AdshiftEventParamValue } from './AdshiftEventParam';
|
|
13
|
+
export { AdshiftMediationNetwork } from './AdshiftAdRevenue';
|
|
14
|
+
export type { AdshiftMediationNetworkValue, AdRevenueParams, } from './AdshiftAdRevenue';
|
|
15
|
+
export { AdshiftErrorCode, isAdshiftError, createAdshiftError, toAdshiftError, } from './AdshiftError';
|
|
16
|
+
export type { AdshiftError, AdshiftErrorInfo } from './AdshiftError';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,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,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,311 @@
|
|
|
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
|
+
import type { AdRevenueParams, AdshiftConfig, AdshiftConsent, AdshiftDeepLink, AdshiftEventTypeValue, AdshiftThirdPartySharing, ConsentSnapshot } from './types';
|
|
33
|
+
import { AdshiftErrorCode } from './types';
|
|
34
|
+
/**
|
|
35
|
+
* Result of `Adshift.start()`.
|
|
36
|
+
*
|
|
37
|
+
* `success` reports whether the SDK started locally. Backend validation of
|
|
38
|
+
* the API key continues in the background; a rejected key is reported through
|
|
39
|
+
* `config.onError` as `INVALID_API_KEY`.
|
|
40
|
+
*/
|
|
41
|
+
export interface StartResult {
|
|
42
|
+
success: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Outcome of the API key check at the time `start()` resolved.
|
|
45
|
+
* `pending` means the answer had not arrived yet when `start()` resolved; it
|
|
46
|
+
* changes nothing you have to do, since the SDK keeps the data either way.
|
|
47
|
+
*/
|
|
48
|
+
apiKeyValidationStatus?: ApiKeyValidationStatus;
|
|
49
|
+
/** Platform error number behind `errorCode`, for support requests. */
|
|
50
|
+
nativeCode?: number | string;
|
|
51
|
+
/** Platform error domain behind `errorCode`. @platform ios */
|
|
52
|
+
nativeDomain?: string;
|
|
53
|
+
/** Set when `success` is false. */
|
|
54
|
+
errorCode?: AdshiftErrorCode;
|
|
55
|
+
/** Set when `success` is false. */
|
|
56
|
+
errorMessage?: string;
|
|
57
|
+
}
|
|
58
|
+
/** How far the API key check had got when `start()` resolved. */
|
|
59
|
+
export type ApiKeyValidationStatus = 'pending' | 'valid' | 'invalid';
|
|
60
|
+
export type EventValues = Record<string, string | number | boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Parameters for `Adshift.trackPurchase()`.
|
|
63
|
+
*/
|
|
64
|
+
export interface PurchaseParams {
|
|
65
|
+
/** Product identifier. */
|
|
66
|
+
productId: string;
|
|
67
|
+
/** Purchase amount in `currency`. */
|
|
68
|
+
revenue: number;
|
|
69
|
+
/** ISO 4217 currency code, e.g. `USD`. */
|
|
70
|
+
currency: string;
|
|
71
|
+
/** Transaction id or purchase token. */
|
|
72
|
+
transactionId: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Subscription returned by `Adshift.onDeepLink()`.
|
|
76
|
+
*/
|
|
77
|
+
export interface DeepLinkSubscription {
|
|
78
|
+
/** Removes the listener. Safe to call more than once. */
|
|
79
|
+
remove(): void;
|
|
80
|
+
}
|
|
81
|
+
export type DeepLinkCallback = (deepLink: AdshiftDeepLink) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Native SDK versions bundled with this plugin release.
|
|
84
|
+
*/
|
|
85
|
+
export interface NativeSdkVersions {
|
|
86
|
+
android: string;
|
|
87
|
+
ios: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Plugin information returned by `Adshift.getInfo()`.
|
|
91
|
+
*/
|
|
92
|
+
export interface AdshiftInfo {
|
|
93
|
+
/** `Platform.OS`; the SDK only supports `ios` and `android`. */
|
|
94
|
+
platform: 'ios' | 'android' | (string & {});
|
|
95
|
+
/** Plugin version. */
|
|
96
|
+
version: string;
|
|
97
|
+
/** Native SDK versions this plugin depends on. */
|
|
98
|
+
nativeSdkVersions: NativeSdkVersions;
|
|
99
|
+
}
|
|
100
|
+
export declare const Adshift: {
|
|
101
|
+
/**
|
|
102
|
+
* Initializes the SDK.
|
|
103
|
+
*
|
|
104
|
+
* Call once, as early as possible (e.g. at module scope of `App.tsx`).
|
|
105
|
+
* The configuration is fixed on the first call; later calls are ignored.
|
|
106
|
+
*
|
|
107
|
+
* Never raises, because it is meant to run at module scope, where an error
|
|
108
|
+
* would stop the bundle from evaluating. An unusable config is reported
|
|
109
|
+
* through `config.onError` and answered by `start()`.
|
|
110
|
+
*/
|
|
111
|
+
readonly initialize: (config: AdshiftConfig) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Starts the SDK.
|
|
114
|
+
*
|
|
115
|
+
* Resolves once the SDK has started locally. Never rejects; inspect
|
|
116
|
+
* `result.success` and `result.errorCode`. Calls to `trackEvent`,
|
|
117
|
+
* `trackPurchase` and `logAdRevenue` made before this resolves are queued
|
|
118
|
+
* and dispatched afterwards. A start that fails with a reason retrying
|
|
119
|
+
* cannot fix rejects them instead; any other failure keeps them waiting for
|
|
120
|
+
* the next attempt.
|
|
121
|
+
*/
|
|
122
|
+
readonly start: () => Promise<StartResult>;
|
|
123
|
+
/**
|
|
124
|
+
* Stops the SDK. Tracking calls reject with `NOT_STARTED` until the next
|
|
125
|
+
* successful `start()`.
|
|
126
|
+
*
|
|
127
|
+
* Before `initialize()` there is nothing to stop: the call is reported and
|
|
128
|
+
* skipped.
|
|
129
|
+
*/
|
|
130
|
+
readonly stop: () => void;
|
|
131
|
+
/**
|
|
132
|
+
* Whether `start()` has completed successfully and `stop()` has not been
|
|
133
|
+
* called since. Safe to call before `initialize()`.
|
|
134
|
+
*/
|
|
135
|
+
readonly isStarted: () => boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Sets your own user identifier. Can be called before or after `start()`.
|
|
138
|
+
*
|
|
139
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
140
|
+
* An empty identifier is reported and skipped; nothing is raised.
|
|
141
|
+
*/
|
|
142
|
+
readonly setCustomerUserId: (userId: string) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Enables or disables verbose SDK logging at runtime.
|
|
145
|
+
*
|
|
146
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
147
|
+
*/
|
|
148
|
+
readonly setDebugEnabled: (enabled: boolean) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Sets the debounce interval for automatic `app_open` events.
|
|
151
|
+
*
|
|
152
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
153
|
+
* A negative interval is reported and skipped; nothing is raised.
|
|
154
|
+
*/
|
|
155
|
+
readonly setAppOpenDebounceMs: (ms: number) => void;
|
|
156
|
+
/**
|
|
157
|
+
* Sets branded attribution domains. Must be called before `start()`.
|
|
158
|
+
*
|
|
159
|
+
* Called before `initialize()`, the domains are kept and applied with the
|
|
160
|
+
* config, so they are in place before the first link is processed.
|
|
161
|
+
*/
|
|
162
|
+
readonly setBrandedDomains: (domains: string[]) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Sets the Meta app id used to parse Meta App Links. No-op on iOS.
|
|
165
|
+
*
|
|
166
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
167
|
+
*/
|
|
168
|
+
readonly setMetaAppId: (appId: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Hands over an OAID the app obtained itself, for Android devices without
|
|
171
|
+
* Google Play services. Set `collectOaid: false` when you supply it this
|
|
172
|
+
* way. No-op on iOS.
|
|
173
|
+
*
|
|
174
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
175
|
+
*/
|
|
176
|
+
readonly setOaidData: (oaid: string) => void;
|
|
177
|
+
/**
|
|
178
|
+
* Sets consent collected by your own UI. Use `AdshiftConsent.forGDPRUser()`
|
|
179
|
+
* or `AdshiftConsent.forNonGDPRUser()`.
|
|
180
|
+
*
|
|
181
|
+
* Called before `initialize()`, the consent is kept and applied afterwards.
|
|
182
|
+
*/
|
|
183
|
+
readonly setConsentData: (consent: AdshiftConsent) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Enables or disables reading IAB TCF v2.2 consent from the CMP on device.
|
|
186
|
+
* Call before `start()`.
|
|
187
|
+
*
|
|
188
|
+
* Called before `initialize()`, the value is kept and applied afterwards.
|
|
189
|
+
*/
|
|
190
|
+
readonly enableTCFDataCollection: (enabled: boolean) => void;
|
|
191
|
+
/**
|
|
192
|
+
* Enables reading an IAB GPP string written by the CMP on device, used for US
|
|
193
|
+
* state privacy signals. Off until called with `true`.
|
|
194
|
+
*
|
|
195
|
+
* The GPP string rides on its own axis: it is forwarded alongside whatever
|
|
196
|
+
* decides the GDPR axis, including a consent set through `setConsentData()`,
|
|
197
|
+
* and it does not gate the advertising identifier on the device.
|
|
198
|
+
*
|
|
199
|
+
* Call before `start()`. Called before `initialize()`, the value is kept and
|
|
200
|
+
* applied afterwards.
|
|
201
|
+
*/
|
|
202
|
+
readonly enableGPPDataCollection: (enabled: boolean) => void;
|
|
203
|
+
/**
|
|
204
|
+
* States what the app collected about passing this user's data on to
|
|
205
|
+
* advertising partners. Use `AdshiftThirdPartySharing.optedOut()` or
|
|
206
|
+
* `AdshiftThirdPartySharing.allowed()`.
|
|
207
|
+
*
|
|
208
|
+
* This is the answer to a different question than `setConsentData()`, and it
|
|
209
|
+
* has the opposite default: nothing said here means sharing is allowed, so
|
|
210
|
+
* only call it once the user has actually been asked. Setting `allowed()` at
|
|
211
|
+
* startup as a default records a declaration the user never made, and events
|
|
212
|
+
* already sent cannot be recalled when a real answer arrives.
|
|
213
|
+
*
|
|
214
|
+
* Nothing is gated on the device either way — this travels with the events for
|
|
215
|
+
* the backend to act on.
|
|
216
|
+
*
|
|
217
|
+
* Called before `initialize()`, the answer is kept and applied afterwards.
|
|
218
|
+
*/
|
|
219
|
+
readonly setThirdPartySharing: (sharing: AdshiftThirdPartySharing) => void;
|
|
220
|
+
/**
|
|
221
|
+
* Withdraws the answer set by `setThirdPartySharing()`.
|
|
222
|
+
*
|
|
223
|
+
* Subsequent events state nothing on this axis, which is not the same as
|
|
224
|
+
* stating that sharing is allowed: the first leaves the decision to your
|
|
225
|
+
* dashboard configuration, the second is the app's own declaration and is
|
|
226
|
+
* recorded as such.
|
|
227
|
+
*
|
|
228
|
+
* Called before `initialize()`, this cancels a `setThirdPartySharing()` that
|
|
229
|
+
* was also queued.
|
|
230
|
+
*/
|
|
231
|
+
readonly clearThirdPartySharing: () => void;
|
|
232
|
+
/**
|
|
233
|
+
* Re-reads consent from the CMP or manual source and returns the snapshot.
|
|
234
|
+
* Call after the CMP dialog closes.
|
|
235
|
+
*
|
|
236
|
+
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`).
|
|
237
|
+
*/
|
|
238
|
+
readonly refreshConsent: () => Promise<ConsentSnapshot>;
|
|
239
|
+
/**
|
|
240
|
+
* Tracks an in-app event.
|
|
241
|
+
*
|
|
242
|
+
* `app_install` and `app_open` are reserved: the SDK sends them itself and
|
|
243
|
+
* passing them here rejects with `INVALID_ARGUMENT`.
|
|
244
|
+
*
|
|
245
|
+
* Resolves once the SDK has accepted the event. A call made between
|
|
246
|
+
* `initialize()` and a successful `start()` waits for the start: it is sent
|
|
247
|
+
* when the SDK starts, and rejects when the start fails for a reason
|
|
248
|
+
* retrying cannot fix (rejected key, excluded device) or after `stop()`.
|
|
249
|
+
* A start that failed for any other reason keeps the call waiting for the
|
|
250
|
+
* next attempt, so `start()` belongs on every launch path.
|
|
251
|
+
*
|
|
252
|
+
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`, `NOT_STARTED`,
|
|
253
|
+
* `INVALID_API_KEY`, `OPTED_OUT`, `QUEUE_FULL`, `INVALID_ARGUMENT`).
|
|
254
|
+
*/
|
|
255
|
+
readonly trackEvent: (eventName: AdshiftEventTypeValue | (string & {}), values?: EventValues) => Promise<void>;
|
|
256
|
+
/**
|
|
257
|
+
* Tracks a purchase.
|
|
258
|
+
*
|
|
259
|
+
* @returns Rejects with `AdshiftError` (see `trackEvent`).
|
|
260
|
+
*/
|
|
261
|
+
readonly trackPurchase: (params: PurchaseParams) => Promise<void>;
|
|
262
|
+
/**
|
|
263
|
+
* Logs ad revenue for a single impression.
|
|
264
|
+
*
|
|
265
|
+
* @returns Rejects with `AdshiftError` (see `trackEvent`).
|
|
266
|
+
*/
|
|
267
|
+
readonly logAdRevenue: (params: AdRevenueParams) => Promise<void>;
|
|
268
|
+
/**
|
|
269
|
+
* Returns the AdShift device id, or `null` before `initialize()`.
|
|
270
|
+
*/
|
|
271
|
+
readonly getAdShiftDeviceId: () => Promise<string | null>;
|
|
272
|
+
/**
|
|
273
|
+
* Passes a URL to the SDK.
|
|
274
|
+
*
|
|
275
|
+
* Not needed when `autoHandleDeepLinks` is on (the default). The result is
|
|
276
|
+
* delivered through `onDeepLink()`; the promise resolves once the SDK has
|
|
277
|
+
* finished processing the URL.
|
|
278
|
+
*
|
|
279
|
+
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
|
|
280
|
+
* `INVALID_ARGUMENT`).
|
|
281
|
+
*/
|
|
282
|
+
readonly handleDeepLink: (url: string) => Promise<void>;
|
|
283
|
+
/**
|
|
284
|
+
* Adds a key path inside push payloads that carries an AdShift deep link.
|
|
285
|
+
*
|
|
286
|
+
* Called before `initialize()`, the path is kept and registered afterwards.
|
|
287
|
+
* The first path you register takes over from the top-level `as_push_link`
|
|
288
|
+
* the SDK reads on its own, so register that key too if you still need it.
|
|
289
|
+
*/
|
|
290
|
+
readonly addPushNotificationDeepLinkPath: (path: string[]) => void;
|
|
291
|
+
/**
|
|
292
|
+
* Passes a push notification payload to the SDK. Resolves to `true` when
|
|
293
|
+
* the payload carried an AdShift deep link; the result then arrives
|
|
294
|
+
* through `onDeepLink()`.
|
|
295
|
+
*
|
|
296
|
+
* @returns Rejects with `AdshiftError` (`NOT_INITIALIZED`,
|
|
297
|
+
* `INVALID_ARGUMENT`).
|
|
298
|
+
*/
|
|
299
|
+
readonly handlePushNotification: (payload: Record<string, unknown>) => Promise<boolean>;
|
|
300
|
+
/**
|
|
301
|
+
* Registers a deep link listener.
|
|
302
|
+
*
|
|
303
|
+
* Safe to call before `initialize()`. Results that arrive while no
|
|
304
|
+
* listener is registered are buffered and delivered to the first listener.
|
|
305
|
+
* Every link that reaches the SDK (direct, deferred, push) is delivered.
|
|
306
|
+
*/
|
|
307
|
+
readonly onDeepLink: (callback: DeepLinkCallback) => DeepLinkSubscription;
|
|
308
|
+
readonly getInfo: () => AdshiftInfo;
|
|
309
|
+
};
|
|
310
|
+
export default Adshift;
|
|
311
|
+
//# sourceMappingURL=Adshift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Adshift.d.ts","sourceRoot":"","sources":["../../../../src/Adshift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAOH,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EAEf,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,gBAAgB,EAUjB,MAAM,SAAS,CAAC;AAKjB;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,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,S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module.
|
|
4
|
+
*
|
|
5
|
+
* Every field except `params`, `isDeferred` and `status` is optional.
|
|
6
|
+
* `params` is always present (possibly empty).
|
|
7
|
+
*/
|
|
8
|
+
export type NativeDeepLinkPayload = {
|
|
9
|
+
deepLink?: string;
|
|
10
|
+
deepLinkValue?: string;
|
|
11
|
+
params: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
isDeferred: boolean;
|
|
15
|
+
status: string;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
deepLinkSub1?: string;
|
|
18
|
+
deepLinkSub2?: string;
|
|
19
|
+
deepLinkSub3?: string;
|
|
20
|
+
deepLinkSub4?: string;
|
|
21
|
+
deepLinkSub5?: string;
|
|
22
|
+
isFirstSession?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* TurboModule contract between JavaScript and native code.
|
|
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`.
|
|
30
|
+
*/
|
|
31
|
+
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
|
+
*/
|
|
41
|
+
initialize(config: Object): void;
|
|
42
|
+
/**
|
|
43
|
+
* Starts the SDK. Resolves once the SDK has started locally.
|
|
44
|
+
*
|
|
45
|
+
* Result keys: `success: boolean`, `apiKeyValidationStatus?: string`
|
|
46
|
+
* (`pending` | `valid` | `invalid`), `errorCode?: string`,
|
|
47
|
+
* `errorMessage?: string`, `nativeCode?: number | string`.
|
|
48
|
+
*/
|
|
49
|
+
start(): Promise<Object>;
|
|
50
|
+
/** Suspends delivery. Can be resumed with `start()`. */
|
|
51
|
+
stop(): void;
|
|
52
|
+
setCustomerUserId(userId: string): void;
|
|
53
|
+
setDebugEnabled(enabled: boolean): void;
|
|
54
|
+
setAppOpenDebounceMs(ms: number): void;
|
|
55
|
+
/** Branded attribution domains. Must precede `start()`. */
|
|
56
|
+
setBrandedDomains(domains: string[]): void;
|
|
57
|
+
/** Meta app id for Meta deep link parsing. Android only; no-op on iOS. */
|
|
58
|
+
setMetaAppId(appId: string): void;
|
|
59
|
+
/** OAID read by the app itself. Android only; no-op on iOS. */
|
|
60
|
+
setOaidData(oaid: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Consent keys: `isUserSubjectToGDPR: boolean`,
|
|
63
|
+
* `hasConsentForDataUsage` / `hasConsentForAdsPersonalization` /
|
|
64
|
+
* `hasConsentForAdStorage`: `boolean | null` (null = not decided).
|
|
65
|
+
*/
|
|
66
|
+
setConsentData(consent: Object): void;
|
|
67
|
+
enableTCFDataCollection(enabled: boolean): void;
|
|
68
|
+
enableGPPDataCollection(enabled: boolean): void;
|
|
69
|
+
/** Sharing key: `optOut: boolean`. */
|
|
70
|
+
setThirdPartySharing(sharing: Object): void;
|
|
71
|
+
clearThirdPartySharing(): void;
|
|
72
|
+
/** Resolves to a consent snapshot object. */
|
|
73
|
+
refreshConsent(): Promise<Object>;
|
|
74
|
+
/** Resolves once the event has been accepted by the SDK queue. */
|
|
75
|
+
trackEvent(eventName: string, values: Object | null): Promise<void>;
|
|
76
|
+
trackPurchase(productId: string, price: number, currency: string, token: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Ad revenue keys: `monetizationNetwork`, `mediationNetwork`, `currency`,
|
|
79
|
+
* `revenue`, optional `adUnitId`, `precision`, `additionalParameters`.
|
|
80
|
+
*/
|
|
81
|
+
logAdRevenue(data: Object): Promise<void>;
|
|
82
|
+
/** Resolves to the AdShift device id, or null before initialization. */
|
|
83
|
+
getAdShiftDeviceId(): Promise<string | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Passes a URL to the SDK. Resolves once processing has completed;
|
|
86
|
+
* the result arrives through `onDeepLink`.
|
|
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.
|
|
92
|
+
*/
|
|
93
|
+
handleDeepLink(url: string, fromLaunch: boolean): Promise<void>;
|
|
94
|
+
/** Registers a push payload key path that carries a deep link. */
|
|
95
|
+
addPushNotificationDeepLinkPath(path: string[]): void;
|
|
96
|
+
/** Resolves to true when the payload was recognised as an AdShift push. */
|
|
97
|
+
handlePushNotification(payload: Object): Promise<boolean>;
|
|
98
|
+
readonly onDeepLink: CodegenTypes.EventEmitter<NativeDeepLinkPayload>;
|
|
99
|
+
}
|
|
100
|
+
declare const _default: Spec;
|
|
101
|
+
export default _default;
|
|
102
|
+
//# sourceMappingURL=NativeAdShiftReactNativePlugin.d.ts.map
|
|
@@ -0,0 +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;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACp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,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAIlC,kEAAkE;IAClE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpE,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAI1C,wEAAwE;IACxE,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAI7C;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,kEAAkE;IAClE,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEtD,2EAA2E;IAC3E,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1D,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;CACvE;;AAED,wBAEE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
export { Adshift, default } from './Adshift';
|
|
34
|
+
export type { StartResult, EventValues, PurchaseParams, DeepLinkSubscription, DeepLinkCallback, NativeSdkVersions, AdshiftInfo, } from './Adshift';
|
|
35
|
+
export type { AdshiftConfig } from './types';
|
|
36
|
+
export { AdshiftConsent } from './types';
|
|
37
|
+
export type { AdshiftConsent as AdshiftConsentType, ConsentFlag, ConsentSnapshot, ConsentSource, } from './types';
|
|
38
|
+
export { AdshiftThirdPartySharing } from './types';
|
|
39
|
+
export type { AdshiftThirdPartySharing as AdshiftThirdPartySharingType } from './types';
|
|
40
|
+
export { AdshiftDeepLinkStatus, AdshiftDeepLink } from './types';
|
|
41
|
+
export type { AdshiftDeepLink as AdshiftDeepLinkType } from './types';
|
|
42
|
+
export { AdshiftEventType, getAllEventTypes } from './types';
|
|
43
|
+
export type { AdshiftEventTypeValue } from './types';
|
|
44
|
+
export { AdshiftEventParam, getAllEventParams } from './types';
|
|
45
|
+
export type { AdshiftEventParamValue } from './types';
|
|
46
|
+
export { AdshiftMediationNetwork } from './types';
|
|
47
|
+
export type { AdshiftMediationNetworkValue, AdRevenueParams } from './types';
|
|
48
|
+
export { AdshiftErrorCode, isAdshiftError } from './types';
|
|
49
|
+
export type { AdshiftError, AdshiftErrorInfo } from './types';
|
|
50
|
+
export { PLUGIN_VERSION } from './version';
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,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;AAGnB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EACV,cAAc,IAAI,kBAAkB,EACpC,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,YAAY,EAAE,wBAAwB,IAAI,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIxF,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACjE,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;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,YAAY,EAAE,4BAA4B,EAAE,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