@adshift/react-native-plugin 1.0.0 → 2.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 +11 -7
- package/CHANGELOG.md +138 -0
- package/README.md +513 -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 +1138 -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 +962 -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 +314 -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 +314 -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 +50 -11
- package/src/Adshift.ts +1276 -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,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jest support for apps that use `@adshift/react-native-plugin`.
|
|
3
|
+
*
|
|
4
|
+
* The plugin resolves its native module at import time, which fails in a
|
|
5
|
+
* plain Jest environment. Register this mock in your Jest setup file:
|
|
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.
|
|
16
|
+
*/
|
|
17
|
+
import type { AdshiftConfig } from '../types/AdshiftConfig';
|
|
18
|
+
import type { AdshiftConsent as AdshiftConsentType } from '../types/AdshiftConsent';
|
|
19
|
+
import { AdshiftConsent } from '../types/AdshiftConsent';
|
|
20
|
+
import type { AdshiftThirdPartySharing as AdshiftThirdPartySharingType } from '../types/AdshiftThirdPartySharing';
|
|
21
|
+
import { AdshiftThirdPartySharing } from '../types/AdshiftThirdPartySharing';
|
|
22
|
+
import type { AdshiftDeepLink as AdshiftDeepLinkType } from '../types/AdshiftDeepLink';
|
|
23
|
+
import { AdshiftDeepLink, AdshiftDeepLinkStatus } from '../types/AdshiftDeepLink';
|
|
24
|
+
import { AdshiftEventType, getAllEventTypes } from '../types/AdshiftEventType';
|
|
25
|
+
import { AdshiftEventParam, getAllEventParams } from '../types/AdshiftEventParam';
|
|
26
|
+
import { AdshiftMediationNetwork } from '../types/AdshiftAdRevenue';
|
|
27
|
+
import { AdshiftErrorCode, createAdshiftError, isAdshiftError } from '../types/AdshiftError';
|
|
28
|
+
type MockFn<T extends (...args: never[]) => unknown> = jest.Mock<ReturnType<T>, Parameters<T>>;
|
|
29
|
+
type Listener = (deepLink: AdshiftDeepLinkType) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Mocked `Adshift` object with test helpers.
|
|
32
|
+
*/
|
|
33
|
+
export interface AdshiftMock {
|
|
34
|
+
initialize: MockFn<(config: AdshiftConfig) => void>;
|
|
35
|
+
start: MockFn<() => Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
}>>;
|
|
38
|
+
stop: MockFn<() => void>;
|
|
39
|
+
isStarted: MockFn<() => boolean>;
|
|
40
|
+
setCustomerUserId: MockFn<(userId: string) => void>;
|
|
41
|
+
setDebugEnabled: MockFn<(enabled: boolean) => void>;
|
|
42
|
+
setAppOpenDebounceMs: MockFn<(ms: number) => void>;
|
|
43
|
+
setBrandedDomains: MockFn<(domains: string[]) => void>;
|
|
44
|
+
setMetaAppId: MockFn<(appId: string) => void>;
|
|
45
|
+
setOaidData: MockFn<(oaid: string) => void>;
|
|
46
|
+
setConsentData: MockFn<(consent: AdshiftConsentType) => void>;
|
|
47
|
+
enableTCFDataCollection: MockFn<(enabled: boolean) => void>;
|
|
48
|
+
enableGPPDataCollection: MockFn<(enabled: boolean) => void>;
|
|
49
|
+
setThirdPartySharing: MockFn<(sharing: AdshiftThirdPartySharingType) => void>;
|
|
50
|
+
clearThirdPartySharing: MockFn<() => void>;
|
|
51
|
+
refreshConsent: MockFn<() => Promise<Record<string, unknown>>>;
|
|
52
|
+
trackEvent: MockFn<(eventName: string, values?: Record<string, unknown>) => Promise<void>>;
|
|
53
|
+
trackPurchase: MockFn<(params: Record<string, unknown>) => Promise<void>>;
|
|
54
|
+
logAdRevenue: MockFn<(params: Record<string, unknown>) => Promise<void>>;
|
|
55
|
+
getAdShiftDeviceId: MockFn<() => Promise<string | null>>;
|
|
56
|
+
handleDeepLink: MockFn<(url: string) => Promise<void>>;
|
|
57
|
+
addPushNotificationDeepLinkPath: MockFn<(path: string[]) => void>;
|
|
58
|
+
handlePushNotification: MockFn<(payload: Record<string, unknown>) => Promise<boolean>>;
|
|
59
|
+
onDeepLink: MockFn<(callback: Listener) => {
|
|
60
|
+
remove: () => void;
|
|
61
|
+
}>;
|
|
62
|
+
getInfo: MockFn<() => {
|
|
63
|
+
platform: string;
|
|
64
|
+
version: string;
|
|
65
|
+
nativeSdkVersions: {
|
|
66
|
+
android: string;
|
|
67
|
+
ios: string;
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
/** Test helper: delivers a deep link to every registered listener. */
|
|
71
|
+
__emitDeepLink(deepLink: AdshiftDeepLinkType): void;
|
|
72
|
+
/**
|
|
73
|
+
* Test helper: returns the mock to the state it had when it was created —
|
|
74
|
+
* listeners gone, started flag down, recorded calls and any per-test
|
|
75
|
+
* behaviour dropped, default answers back in place.
|
|
76
|
+
*/
|
|
77
|
+
__reset(): void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Shape returned by `createAdshiftMock()`; mirrors the package exports.
|
|
81
|
+
*/
|
|
82
|
+
export interface AdshiftModuleMock {
|
|
83
|
+
Adshift: AdshiftMock;
|
|
84
|
+
default: AdshiftMock;
|
|
85
|
+
AdshiftConsent: typeof AdshiftConsent;
|
|
86
|
+
AdshiftThirdPartySharing: typeof AdshiftThirdPartySharing;
|
|
87
|
+
AdshiftDeepLink: typeof AdshiftDeepLink;
|
|
88
|
+
AdshiftDeepLinkStatus: typeof AdshiftDeepLinkStatus;
|
|
89
|
+
AdshiftEventType: typeof AdshiftEventType;
|
|
90
|
+
getAllEventTypes: typeof getAllEventTypes;
|
|
91
|
+
AdshiftEventParam: typeof AdshiftEventParam;
|
|
92
|
+
getAllEventParams: typeof getAllEventParams;
|
|
93
|
+
AdshiftMediationNetwork: typeof AdshiftMediationNetwork;
|
|
94
|
+
AdshiftErrorCode: typeof AdshiftErrorCode;
|
|
95
|
+
isAdshiftError: typeof isAdshiftError;
|
|
96
|
+
PLUGIN_VERSION: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Creates a fresh mock of the package. Call inside `jest.mock()`.
|
|
100
|
+
*/
|
|
101
|
+
export declare function createAdshiftMock(): AdshiftModuleMock;
|
|
102
|
+
export { AdshiftErrorCode, createAdshiftError, isAdshiftError };
|
|
103
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/jest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;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,eAA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AE,OAAO,cAAc,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CAkGrD;AAED,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native SDK versions this plugin is pinned to.
|
|
3
|
+
*
|
|
4
|
+
* 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.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NATIVE_SDK_VERSIONS: Readonly<{
|
|
8
|
+
android: "3.2.0";
|
|
9
|
+
ios: "2.4.0";
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=nativeSdkVersions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeSdkVersions.d.ts","sourceRoot":"","sources":["../../../../src/nativeSdkVersions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mediation platform that reported the ad impression.
|
|
3
|
+
*
|
|
4
|
+
* Values are the identifiers used on the wire by the native SDKs.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AdshiftMediationNetwork: {
|
|
7
|
+
readonly AppLovinMAX: "applovin_max";
|
|
8
|
+
readonly GoogleAdMob: "google_admob";
|
|
9
|
+
readonly IronSource: "ironsource";
|
|
10
|
+
readonly Chartboost: "chartboost";
|
|
11
|
+
readonly TopOn: "topon";
|
|
12
|
+
readonly TradPlus: "tradplus";
|
|
13
|
+
readonly AdMost: "admost";
|
|
14
|
+
readonly Appodeal: "appodeal";
|
|
15
|
+
readonly Fyber: "fyber";
|
|
16
|
+
readonly Unity: "unity";
|
|
17
|
+
readonly Yandex: "yandex";
|
|
18
|
+
readonly CustomMediation: "custom_mediation";
|
|
19
|
+
readonly DirectMonetization: "direct_monetization_network";
|
|
20
|
+
readonly Other: "other";
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Type of all mediation network values.
|
|
24
|
+
*/
|
|
25
|
+
export type AdshiftMediationNetworkValue = (typeof AdshiftMediationNetwork)[keyof typeof AdshiftMediationNetwork];
|
|
26
|
+
/**
|
|
27
|
+
* Parameters for `Adshift.logAdRevenue()`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* await Adshift.logAdRevenue({
|
|
32
|
+
* monetizationNetwork: 'admob',
|
|
33
|
+
* mediationNetwork: AdshiftMediationNetwork.GoogleAdMob,
|
|
34
|
+
* currency: 'USD',
|
|
35
|
+
* revenue: 0.0125,
|
|
36
|
+
* adUnitId: 'ca-app-pub-1234/5678',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export interface AdRevenueParams {
|
|
41
|
+
/** Ad network that served the impression, e.g. `admob`, `meta`. */
|
|
42
|
+
monetizationNetwork: string;
|
|
43
|
+
/** Mediation platform that reported the impression. */
|
|
44
|
+
mediationNetwork: AdshiftMediationNetworkValue;
|
|
45
|
+
/** ISO 4217 currency code, e.g. `USD`. */
|
|
46
|
+
currency: string;
|
|
47
|
+
/** Revenue of the single impression in `currency`. Must be positive. */
|
|
48
|
+
revenue: number;
|
|
49
|
+
/** Ad unit identifier, when available. */
|
|
50
|
+
adUnitId?: string;
|
|
51
|
+
/** Revenue precision reported by the network, e.g. `exact`, `estimated`. */
|
|
52
|
+
precision?: string;
|
|
53
|
+
/** Extra parameters attached to the event. */
|
|
54
|
+
additionalParameters?: Record<string, string | number | boolean>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=AdshiftAdRevenue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftAdRevenue.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftAdRevenue.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;CAe1B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACtC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { AdshiftError } from './AdshiftError';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for initializing the AdShift SDK.
|
|
4
|
+
*
|
|
5
|
+
* Every option other than `apiKey` is optional; omitted options keep the
|
|
6
|
+
* native SDK defaults. All options must be set before `Adshift.start()`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* Adshift.initialize({
|
|
11
|
+
* apiKey: 'your-api-key',
|
|
12
|
+
* isDebug: __DEV__,
|
|
13
|
+
* brandedDomains: ['links.example.com'],
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface AdshiftConfig {
|
|
18
|
+
/**
|
|
19
|
+
* API key from the AdShift dashboard. Required.
|
|
20
|
+
*/
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/**
|
|
23
|
+
* Enable verbose SDK logging.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
isDebug?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Debounce interval for automatic `app_open` events, in milliseconds.
|
|
29
|
+
* @default 10000
|
|
30
|
+
*/
|
|
31
|
+
appOpenDebounceMs?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Branded (custom) attribution domains, e.g. `links.example.com`.
|
|
34
|
+
* Links on these hosts are treated as attribution links.
|
|
35
|
+
*/
|
|
36
|
+
brandedDomains?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Meta app id used to parse Meta App Links.
|
|
39
|
+
* @platform android
|
|
40
|
+
*/
|
|
41
|
+
metaAppId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Key paths inside a push notification payload that carry an AdShift deep
|
|
44
|
+
* link, e.g. `[['data', 'as_push_link']]`. Registering your own paths takes
|
|
45
|
+
* over from the top-level `as_push_link` the SDK reads on its own, so list
|
|
46
|
+
* that key too if your payloads also use it.
|
|
47
|
+
*/
|
|
48
|
+
pushDeepLinkPaths?: string[][];
|
|
49
|
+
/**
|
|
50
|
+
* Forward every URL that opens the app to the SDK automatically.
|
|
51
|
+
*
|
|
52
|
+
* Android: the plugin reads the launch Intent and every new Intent.
|
|
53
|
+
* iOS: the plugin uses `Linking` (`getInitialURL` and the `url` event).
|
|
54
|
+
* Set to `false` to call `Adshift.handleDeepLink()` yourself.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
autoHandleDeepLinks?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Disable SKAdNetwork integration.
|
|
60
|
+
* @default false
|
|
61
|
+
* @platform ios
|
|
62
|
+
*/
|
|
63
|
+
disableSKAN?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Wait for the App Tracking Transparency decision before the first
|
|
66
|
+
* install/open event. Only useful when the app requests ATT itself.
|
|
67
|
+
* @default false
|
|
68
|
+
* @platform ios
|
|
69
|
+
*/
|
|
70
|
+
waitForATTBeforeStart?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Maximum time to wait for the ATT decision, in milliseconds. The SDK
|
|
73
|
+
* clamps the value to 5000 – 120000 instead of rejecting it.
|
|
74
|
+
* @default 30000
|
|
75
|
+
* @platform ios
|
|
76
|
+
*/
|
|
77
|
+
attTimeoutMs?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Enable OAID collection on devices without Google Play services.
|
|
80
|
+
* @default true
|
|
81
|
+
* @platform android
|
|
82
|
+
*/
|
|
83
|
+
collectOaid?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Called when the SDK declines a call it cannot make: an invalid argument,
|
|
86
|
+
* an unusable config, or an API key the backend rejected.
|
|
87
|
+
*
|
|
88
|
+
* Methods that return nothing cannot answer the caller, and the SDK never
|
|
89
|
+
* raises into your code, so this is how those failures become visible. In
|
|
90
|
+
* development they are also written to the console. Wire it to your own
|
|
91
|
+
* reporting to catch integration mistakes in release builds.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* Adshift.initialize({
|
|
96
|
+
* apiKey: 'your-api-key',
|
|
97
|
+
* onError: (error) => Sentry.captureMessage(`AdShift: ${error.code}`),
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
onError?: (error: AdshiftError) => void;
|
|
102
|
+
}
|
|
103
|
+
export declare function configToMap(config: AdshiftConfig): Record<string, unknown>;
|
|
104
|
+
//# sourceMappingURL=AdshiftConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAE/B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAI9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAItB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACzC;AA2BD,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS1E"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single consent decision.
|
|
3
|
+
*
|
|
4
|
+
* `true` = granted, `false` = denied, `null` = not decided yet.
|
|
5
|
+
* Undecided flags are not sent to the backend.
|
|
6
|
+
*/
|
|
7
|
+
export type ConsentFlag = boolean | null;
|
|
8
|
+
/**
|
|
9
|
+
* User consent data for GDPR/DMA compliance.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // GDPR user who accepted everything
|
|
14
|
+
* Adshift.setConsentData(
|
|
15
|
+
* AdshiftConsent.forGDPRUser({
|
|
16
|
+
* hasConsentForDataUsage: true,
|
|
17
|
+
* hasConsentForAdsPersonalization: true,
|
|
18
|
+
* hasConsentForAdStorage: true,
|
|
19
|
+
* })
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* // Non-GDPR user
|
|
23
|
+
* Adshift.setConsentData(AdshiftConsent.forNonGDPRUser());
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface AdshiftConsent {
|
|
27
|
+
/** Whether the user is subject to GDPR. */
|
|
28
|
+
isUserSubjectToGDPR: boolean;
|
|
29
|
+
/** Consent to data usage. Ignored when `isUserSubjectToGDPR` is false. */
|
|
30
|
+
hasConsentForDataUsage?: ConsentFlag;
|
|
31
|
+
/** Consent to ads personalization. Ignored when `isUserSubjectToGDPR` is false. */
|
|
32
|
+
hasConsentForAdsPersonalization?: ConsentFlag;
|
|
33
|
+
/** Consent to ad storage. Ignored when `isUserSubjectToGDPR` is false. */
|
|
34
|
+
hasConsentForAdStorage?: ConsentFlag;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Helper functions for creating `AdshiftConsent` objects.
|
|
38
|
+
*/
|
|
39
|
+
export declare const AdshiftConsent: {
|
|
40
|
+
/**
|
|
41
|
+
* Creates consent for a user subject to GDPR.
|
|
42
|
+
*
|
|
43
|
+
* Flags that are omitted or `null` are treated as not decided.
|
|
44
|
+
*/
|
|
45
|
+
forGDPRUser(options: {
|
|
46
|
+
hasConsentForDataUsage?: ConsentFlag;
|
|
47
|
+
hasConsentForAdsPersonalization?: ConsentFlag;
|
|
48
|
+
hasConsentForAdStorage?: ConsentFlag;
|
|
49
|
+
}): AdshiftConsent;
|
|
50
|
+
/**
|
|
51
|
+
* Creates consent for a user NOT subject to GDPR.
|
|
52
|
+
*
|
|
53
|
+
* All processing is treated as permitted; individual flags are not sent.
|
|
54
|
+
*/
|
|
55
|
+
forNonGDPRUser(): AdshiftConsent;
|
|
56
|
+
/**
|
|
57
|
+
* Whether consent is granted for tracking, following the SDK rule:
|
|
58
|
+
* non-GDPR users are always granted; GDPR users need explicit consent to
|
|
59
|
+
* both data usage and ad storage.
|
|
60
|
+
*/
|
|
61
|
+
isConsentGranted(consent: AdshiftConsent): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Creates consent from a plain object.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
fromMap(map: Record<string, unknown>): AdshiftConsent;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Converts `AdshiftConsent` to a plain object for the native bridge.
|
|
71
|
+
* Undecided flags are sent as `null`.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare function consentToMap(consent: AdshiftConsent): Record<string, boolean | null>;
|
|
76
|
+
//# sourceMappingURL=AdshiftConsent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftConsent.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConsent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,mBAAmB,EAAE,OAAO,CAAC;IAE7B,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,WAAW,CAAC;IAErC,mFAAmF;IACnF,+BAA+B,CAAC,EAAE,WAAW,CAAC;IAE9C,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,WAAW,CAAC;CACtC;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;;;OAIG;yBACkB;QACnB,sBAAsB,CAAC,EAAE,WAAW,CAAC;QACrC,+BAA+B,CAAC,EAAE,WAAW,CAAC;QAC9C,sBAAsB,CAAC,EAAE,WAAW,CAAC;KACtC,GAAG,cAAc;IAUlB;;;;OAIG;sBACe,cAAc;IAIhC;;;;OAIG;8BACuB,cAAc,GAAG,OAAO;IAQlD;;;;OAIG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc;CActD,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,cAAc,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAWhC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the current consent state comes from.
|
|
3
|
+
*
|
|
4
|
+
* - `manual`: set through `Adshift.setConsentData()`
|
|
5
|
+
* - `tcf`: read from an IAB TCF v2.2 CMP
|
|
6
|
+
* - `gpp`: read from an IAB GPP string written by the CMP
|
|
7
|
+
* - `none`: no consent information available
|
|
8
|
+
*/
|
|
9
|
+
export type ConsentSource = 'manual' | 'tcf' | 'gpp' | 'none';
|
|
10
|
+
/**
|
|
11
|
+
* Consent state as seen by the SDK, returned by `Adshift.refreshConsent()`.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConsentSnapshot {
|
|
14
|
+
source: ConsentSource;
|
|
15
|
+
/** IAB `gdprApplies` value when known (0 or 1). */
|
|
16
|
+
gdprApplies?: number;
|
|
17
|
+
/** Whether a TCF consent string is present on the device. */
|
|
18
|
+
tcStringPresent: boolean;
|
|
19
|
+
/** Whether a GPP string is present on the device. */
|
|
20
|
+
gppPresent?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a CMP has run on this device, judged by the keys a CMP writes when
|
|
23
|
+
* it starts rather than by a consent payload being readable.
|
|
24
|
+
*
|
|
25
|
+
* This is the field that separates the two cases the flags above cannot: a CMP
|
|
26
|
+
* installed but not yet answered looks identical to no CMP at all, and the two
|
|
27
|
+
* are fixed by opposite actions. `false` while you expect a CMP means it never
|
|
28
|
+
* ran or was never wired up; `true` with `source: 'none'` means it ran and the
|
|
29
|
+
* user has not answered yet, which resolves itself once they do.
|
|
30
|
+
*/
|
|
31
|
+
cmpDetected: boolean;
|
|
32
|
+
/** Ad user data flag, when decided. */
|
|
33
|
+
adUserDataEnabled?: boolean;
|
|
34
|
+
/** Ad personalization flag, when decided. */
|
|
35
|
+
adPersonalizationEnabled?: boolean;
|
|
36
|
+
/** Ad storage flag, when decided. */
|
|
37
|
+
adStorageEnabled?: boolean;
|
|
38
|
+
/** When the snapshot was applied, in milliseconds since epoch. */
|
|
39
|
+
appliedAtMillis: number;
|
|
40
|
+
/**
|
|
41
|
+
* Whether consent lets the SDK attach the platform advertising identifier
|
|
42
|
+
* (GAID or OAID on Android, IDFA on iOS) to what it reports. The
|
|
43
|
+
* `adshift_device_id` is never affected.
|
|
44
|
+
*
|
|
45
|
+
* Each platform answers with the rule it applies to the flags above, and
|
|
46
|
+
* those rules differ, so read this instead of comparing the flags yourself.
|
|
47
|
+
*/
|
|
48
|
+
adIdentifiersAllowed: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Builds a `ConsentSnapshot` from a native bridge object.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export declare function consentSnapshotFromMap(map: Record<string, unknown>): ConsentSnapshot;
|
|
56
|
+
//# sourceMappingURL=AdshiftConsentSnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftConsentSnapshot.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConsentSnapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;OASG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6CAA6C;IAC7C,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAkBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,eAAe,CA4BjB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of a deep link result.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AdshiftDeepLinkStatus {
|
|
5
|
+
/** The link was processed and delivered. */
|
|
6
|
+
Found = "found",
|
|
7
|
+
/** No deep link was found (e.g. organic install, deferred lookup empty). */
|
|
8
|
+
NotFound = "notFound",
|
|
9
|
+
/** An error occurred while resolving the deep link. */
|
|
10
|
+
Error = "error"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Deep link delivered through `Adshift.onDeepLink()`.
|
|
14
|
+
*
|
|
15
|
+
* Every link that enters the app and reaches the SDK produces a result with
|
|
16
|
+
* `status: 'found'`. Route on `deepLinkValue`, `params` or the URL itself.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* Adshift.onDeepLink((deepLink) => {
|
|
21
|
+
* if (deepLink.status === AdshiftDeepLinkStatus.Found) {
|
|
22
|
+
* const productId = deepLink.params?.product_id;
|
|
23
|
+
* }
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export interface AdshiftDeepLink {
|
|
28
|
+
deepLink?: string;
|
|
29
|
+
/** Standardized routing value (`deep_link_value`). */
|
|
30
|
+
deepLinkValue?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Query parameters of the link. On Android `deep_link_sub1` … `sub5` also
|
|
33
|
+
* appear here; on iOS they are only available as the `deepLinkSubN` fields
|
|
34
|
+
* below, which both platforms fill.
|
|
35
|
+
*/
|
|
36
|
+
params?: Record<string, string>;
|
|
37
|
+
/** Whether this result comes from deferred deep linking (first launch). */
|
|
38
|
+
isDeferred: boolean;
|
|
39
|
+
status: AdshiftDeepLinkStatus;
|
|
40
|
+
/** Error message when `status` is `error`. */
|
|
41
|
+
errorMessage?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the result belongs to the first session after install. Android
|
|
44
|
+
* reports it for every result, deferred or not; undefined on iOS.
|
|
45
|
+
*/
|
|
46
|
+
isFirstSession?: boolean;
|
|
47
|
+
/** Custom sub-parameter 1 (`deep_link_sub1`). */
|
|
48
|
+
deepLinkSub1?: string;
|
|
49
|
+
/** Custom sub-parameter 2 (`deep_link_sub2`). */
|
|
50
|
+
deepLinkSub2?: string;
|
|
51
|
+
/** Custom sub-parameter 3 (`deep_link_sub3`). */
|
|
52
|
+
deepLinkSub3?: string;
|
|
53
|
+
/** Custom sub-parameter 4 (`deep_link_sub4`). */
|
|
54
|
+
deepLinkSub4?: string;
|
|
55
|
+
/** Custom sub-parameter 5 (`deep_link_sub5`). */
|
|
56
|
+
deepLinkSub5?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Helper functions for creating `AdshiftDeepLink` objects.
|
|
60
|
+
*/
|
|
61
|
+
export declare const AdshiftDeepLink: {
|
|
62
|
+
found(options: {
|
|
63
|
+
deepLink: string;
|
|
64
|
+
deepLinkValue?: string;
|
|
65
|
+
params?: Record<string, string>;
|
|
66
|
+
isDeferred?: boolean;
|
|
67
|
+
isFirstSession?: boolean;
|
|
68
|
+
deepLinkSub1?: string;
|
|
69
|
+
deepLinkSub2?: string;
|
|
70
|
+
deepLinkSub3?: string;
|
|
71
|
+
deepLinkSub4?: string;
|
|
72
|
+
deepLinkSub5?: string;
|
|
73
|
+
}): AdshiftDeepLink;
|
|
74
|
+
notFound(): AdshiftDeepLink;
|
|
75
|
+
error(message: string): AdshiftDeepLink;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a deep link from a native bridge object.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
fromMap(map: Record<string, unknown>): AdshiftDeepLink;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Converts `AdshiftDeepLink` to a plain object.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
export declare function deepLinkToMap(deepLink: AdshiftDeepLink): Record<string, unknown>;
|
|
89
|
+
//# sourceMappingURL=AdshiftDeepLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftDeepLink.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftDeepLink.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,4CAA4C;IAC5C,KAAK,UAAU;IAEf,4EAA4E;IAC5E,QAAQ,aAAa;IAErB,uDAAuD;IACvD,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,2EAA2E;IAC3E,UAAU,EAAE,OAAO,CAAC;IAEpB,MAAM,EAAE,qBAAqB,CAAC;IAE9B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD;;GAEG;AACH,eAAO,MAAM,eAAe;mBACX;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,eAAe;gBAwBP,eAAe;mBAOZ,MAAM,GAAG,eAAe;IAQvC;;;;OAIG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe;CA8BvD,CAAC;AA2BF;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-neutral error codes used by every rejected promise and by
|
|
3
|
+
* `StartResult.errorCode`.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AdshiftErrorCode {
|
|
6
|
+
/** `Adshift.initialize()` has not been called. */
|
|
7
|
+
NotInitialized = "NOT_INITIALIZED",
|
|
8
|
+
/** The SDK is stopped; call `Adshift.start()` first. */
|
|
9
|
+
NotStarted = "NOT_STARTED",
|
|
10
|
+
/** The API key was rejected by the AdShift backend. */
|
|
11
|
+
InvalidApiKey = "INVALID_API_KEY",
|
|
12
|
+
/** Tracking is disabled for this app on the AdShift side. */
|
|
13
|
+
OptedOut = "OPTED_OUT",
|
|
14
|
+
/** The event queue is full; the call was not accepted. */
|
|
15
|
+
QueueFull = "QUEUE_FULL",
|
|
16
|
+
/** A parameter failed validation. */
|
|
17
|
+
InvalidArgument = "INVALID_ARGUMENT",
|
|
18
|
+
/** Any other failure. See `userInfo.nativeCode` for the platform code. */
|
|
19
|
+
Unknown = "UNKNOWN"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Platform-specific details attached to an `AdshiftError`.
|
|
23
|
+
*/
|
|
24
|
+
export interface AdshiftErrorInfo {
|
|
25
|
+
/** Raw code reported by the native SDK, when available. */
|
|
26
|
+
nativeCode?: number | string;
|
|
27
|
+
/** Error domain on iOS, when available. */
|
|
28
|
+
nativeDomain?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Error thrown or rejected by the AdShift plugin.
|
|
32
|
+
*
|
|
33
|
+
* `code` is always one of `AdshiftErrorCode`; the original native code, when
|
|
34
|
+
* there is one, is available in `userInfo.nativeCode`.
|
|
35
|
+
*/
|
|
36
|
+
export interface AdshiftError extends Error {
|
|
37
|
+
code: AdshiftErrorCode;
|
|
38
|
+
userInfo: AdshiftErrorInfo;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Type guard for errors produced by the plugin.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isAdshiftError(error: unknown): error is AdshiftError;
|
|
44
|
+
/**
|
|
45
|
+
* Builds an `AdshiftError` from a code and message.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function createAdshiftError(code: AdshiftErrorCode, message: string, userInfo?: AdshiftErrorInfo): AdshiftError;
|
|
50
|
+
/**
|
|
51
|
+
* Normalises a promise rejection coming from the native module into an
|
|
52
|
+
* `AdshiftError`. Native modules reject with `{ code, message, userInfo }`.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function toAdshiftError(error: unknown): AdshiftError;
|
|
57
|
+
//# sourceMappingURL=AdshiftError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdshiftError.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,kDAAkD;IAClD,cAAc,oBAAoB;IAClC,wDAAwD;IACxD,UAAU,gBAAgB;IAC1B,uDAAuD;IACvD,aAAa,oBAAoB;IACjC,6DAA6D;IAC7D,QAAQ,cAAc;IACtB,0DAA0D;IAC1D,SAAS,eAAe;IACxB,qCAAqC;IACrC,eAAe,qBAAqB;IACpC,0EAA0E;IAC1E,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAOpE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,gBAAqB,GAC9B,YAAY,CAMd;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CA2B3D"}
|