linktrail-react-native 0.0.1
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/LICENSE +21 -0
- package/LinktrailReactNative.podspec +28 -0
- package/README.md +92 -0
- package/android/build.gradle +74 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/io/linktrail/reactnative/LinkTrailModule.kt +243 -0
- package/android/src/main/java/io/linktrail/reactnative/LinkTrailPackage.kt +26 -0
- package/ios/LinkTrailModule.mm +129 -0
- package/ios/LinkTrailModuleImpl.swift +238 -0
- package/lib/module/NativeLinkTrail.js +15 -0
- package/lib/module/NativeLinkTrail.js.map +1 -0
- package/lib/module/index.js +141 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeLinkTrail.d.ts +47 -0
- package/lib/typescript/src/NativeLinkTrail.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +78 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +99 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +91 -0
- package/src/NativeLinkTrail.ts +63 -0
- package/src/index.ts +183 -0
- package/src/types.ts +107 -0
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "linktrail-react-native",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React Native SDK for LinkTrail — mobile attribution and deferred deep linking. A New Architecture TurboModule wrapping the native LinkTrail iOS and Android SDKs.",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"*.podspec",
|
|
21
|
+
"!android/build",
|
|
22
|
+
"!ios/build",
|
|
23
|
+
"!**/.*"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"typecheck": "tsc",
|
|
27
|
+
"clean": "del-cli lib",
|
|
28
|
+
"prepare": "bob build"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"react-native",
|
|
32
|
+
"linktrail",
|
|
33
|
+
"attribution",
|
|
34
|
+
"deferred-deep-linking",
|
|
35
|
+
"deep-linking",
|
|
36
|
+
"turbomodule",
|
|
37
|
+
"ios",
|
|
38
|
+
"android"
|
|
39
|
+
],
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/linktrail-io/react-native.git"
|
|
43
|
+
},
|
|
44
|
+
"author": "LinkTrail",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/linktrail-io/react-native/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/linktrail-io/react-native#readme",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/react": "^19.0.0",
|
|
55
|
+
"del-cli": "^6.0.0",
|
|
56
|
+
"react": "19.1.0",
|
|
57
|
+
"react-native": "^0.80.0",
|
|
58
|
+
"react-native-builder-bob": "^0.40.6",
|
|
59
|
+
"typescript": "^5.8.3"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "*",
|
|
63
|
+
"react-native": "*"
|
|
64
|
+
},
|
|
65
|
+
"codegenConfig": {
|
|
66
|
+
"name": "LinkTrailSpec",
|
|
67
|
+
"type": "modules",
|
|
68
|
+
"jsSrcsDir": "src",
|
|
69
|
+
"android": {
|
|
70
|
+
"javaPackageName": "io.linktrail.reactnative"
|
|
71
|
+
},
|
|
72
|
+
"ios": {
|
|
73
|
+
"modulesProvider": {
|
|
74
|
+
"LinkTrail": "LinkTrailModule"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"react-native-builder-bob": {
|
|
79
|
+
"source": "src",
|
|
80
|
+
"output": "lib",
|
|
81
|
+
"targets": [
|
|
82
|
+
[
|
|
83
|
+
"module",
|
|
84
|
+
{
|
|
85
|
+
"esm": true
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"typescript"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
import type {
|
|
4
|
+
EventEmitter,
|
|
5
|
+
UnsafeObject,
|
|
6
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Codegen spec for the LinkTrail TurboModule.
|
|
10
|
+
*
|
|
11
|
+
* Payloads that cross the bridge (options, attribution, deep links, events) are
|
|
12
|
+
* typed as `UnsafeObject` here because their shapes contain string-keyed maps
|
|
13
|
+
* (`utm`, `customData`) that codegen cannot express. The public, fully-typed
|
|
14
|
+
* API lives in `types.ts` / `index.ts` — this module is not exported to users.
|
|
15
|
+
*/
|
|
16
|
+
export interface Spec extends TurboModule {
|
|
17
|
+
/**
|
|
18
|
+
* Configures the native SDK. Resolves once configured; rejects with
|
|
19
|
+
* `missing_api_key` when the key is blank.
|
|
20
|
+
*/
|
|
21
|
+
configure(apiKey: string, options?: UnsafeObject): Promise<void>;
|
|
22
|
+
|
|
23
|
+
/** Sends the install event and resolves with the attribution result. */
|
|
24
|
+
trackInstall(force: boolean): Promise<UnsafeObject>;
|
|
25
|
+
|
|
26
|
+
/** Records a custom post-install event; resolves with the server ack. */
|
|
27
|
+
trackEvent(name: string, value?: number, currency?: string): Promise<UnsafeObject>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Handles an incoming deep-link URL. Resolves with the resolved deep link,
|
|
31
|
+
* or `null` when the URL is not a LinkTrail link.
|
|
32
|
+
*/
|
|
33
|
+
handleDeepLink(url: string): Promise<UnsafeObject>;
|
|
34
|
+
|
|
35
|
+
/** The most recent attribution result (cached across launches), or null. */
|
|
36
|
+
getLastAttribution(): Promise<UnsafeObject>;
|
|
37
|
+
|
|
38
|
+
/** The most recent resolved deep link from the current session, or null. */
|
|
39
|
+
getLastDeepLink(): Promise<UnsafeObject>;
|
|
40
|
+
|
|
41
|
+
/** iOS: requests ATT authorization. Android: resolves `false`. */
|
|
42
|
+
requestTrackingAuthorization(): Promise<boolean>;
|
|
43
|
+
|
|
44
|
+
/** iOS: registers for SKAdNetwork attribution. Android: no-op. */
|
|
45
|
+
registerForSKAdAttribution(): void;
|
|
46
|
+
|
|
47
|
+
/** iOS: updates the SKAdNetwork conversion value. Android: no-op. */
|
|
48
|
+
updateConversionValue(value: number, coarseValue?: string): void;
|
|
49
|
+
|
|
50
|
+
/** Clears the install flag, cached attribution, queued events, device id. */
|
|
51
|
+
resetForTesting(): void;
|
|
52
|
+
|
|
53
|
+
/** Fires for both deferred and re-engagement links: `{ link, source }`. */
|
|
54
|
+
readonly onLink: EventEmitter<UnsafeObject>;
|
|
55
|
+
|
|
56
|
+
/** Fires with every attribution result (attributed or organic). */
|
|
57
|
+
readonly onAttribution: EventEmitter<UnsafeObject>;
|
|
58
|
+
|
|
59
|
+
/** Fires when a fire-and-forget native operation fails after retries. */
|
|
60
|
+
readonly onError: EventEmitter<UnsafeObject>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('LinkTrail');
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Linking } from 'react-native';
|
|
2
|
+
import NativeLinkTrail from './NativeLinkTrail';
|
|
3
|
+
import type {
|
|
4
|
+
LinkTrailAttribution,
|
|
5
|
+
LinkTrailCoarseConversionValue,
|
|
6
|
+
LinkTrailDeepLink,
|
|
7
|
+
LinkTrailErrorEvent,
|
|
8
|
+
LinkTrailEventResult,
|
|
9
|
+
LinkTrailLinkSource,
|
|
10
|
+
LinkTrailOptions,
|
|
11
|
+
LinkTrailSubscription,
|
|
12
|
+
} from './types';
|
|
13
|
+
|
|
14
|
+
export * from './types';
|
|
15
|
+
|
|
16
|
+
let linkingSubscription: LinkTrailSubscription | null = null;
|
|
17
|
+
let initialUrlForwarded = false;
|
|
18
|
+
|
|
19
|
+
/** Forwards RN `Linking` URLs (initial + subsequent) to the native SDK. */
|
|
20
|
+
function startLinkForwarding(): void {
|
|
21
|
+
if (!initialUrlForwarded) {
|
|
22
|
+
initialUrlForwarded = true;
|
|
23
|
+
Linking.getInitialURL()
|
|
24
|
+
.then((url) => (url ? NativeLinkTrail.handleDeepLink(url) : null))
|
|
25
|
+
.catch(() => {
|
|
26
|
+
// Non-LinkTrail URLs and transport failures are reported via onError.
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
linkingSubscription ??= Linking.addEventListener('url', ({ url }) => {
|
|
30
|
+
NativeLinkTrail.handleDeepLink(url).catch(() => {});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function stopLinkForwarding(): void {
|
|
35
|
+
linkingSubscription?.remove();
|
|
36
|
+
linkingSubscription = null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const LinkTrail = {
|
|
40
|
+
/**
|
|
41
|
+
* Configures the SDK with your workspace API key (`lt_live_…`). Call once at
|
|
42
|
+
* app launch, before any other LinkTrail API. The install is tracked
|
|
43
|
+
* automatically unless `options.autoTrackInstall` is `false`.
|
|
44
|
+
*
|
|
45
|
+
* Rejects with code `missing_api_key` when the key is blank.
|
|
46
|
+
*/
|
|
47
|
+
async configure(apiKey: string, options: LinkTrailOptions = {}): Promise<void> {
|
|
48
|
+
const { autoHandleLinks = true, ...nativeOptions } = options;
|
|
49
|
+
await NativeLinkTrail.configure(apiKey, nativeOptions);
|
|
50
|
+
if (autoHandleLinks) {
|
|
51
|
+
startLinkForwarding();
|
|
52
|
+
} else {
|
|
53
|
+
stopLinkForwarding();
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Registers a single listener for **both** deferred deep links (first launch
|
|
59
|
+
* after install) and re-engagement links (app already installed) — `source`
|
|
60
|
+
* says which. Fires immediately if a deferred link already resolved this
|
|
61
|
+
* session, so registration order vs. the auto-tracked install doesn't matter.
|
|
62
|
+
*/
|
|
63
|
+
onLink(
|
|
64
|
+
listener: (link: LinkTrailDeepLink, source: LinkTrailLinkSource) => void
|
|
65
|
+
): LinkTrailSubscription {
|
|
66
|
+
return NativeLinkTrail.onLink((payload) => {
|
|
67
|
+
const event = payload as {
|
|
68
|
+
link: LinkTrailDeepLink;
|
|
69
|
+
source: LinkTrailLinkSource;
|
|
70
|
+
};
|
|
71
|
+
listener(event.link, event.source);
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Registers a listener for attribution results (attributed or organic).
|
|
77
|
+
* Fires immediately with the cached result if one already exists.
|
|
78
|
+
*/
|
|
79
|
+
onAttribution(
|
|
80
|
+
listener: (attribution: LinkTrailAttribution) => void
|
|
81
|
+
): LinkTrailSubscription {
|
|
82
|
+
return NativeLinkTrail.onAttribution((payload) => {
|
|
83
|
+
listener(payload as unknown as LinkTrailAttribution);
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Registers a listener invoked when a fire-and-forget native operation
|
|
89
|
+
* (auto-tracked install, queued event, link open) fails after retries.
|
|
90
|
+
*/
|
|
91
|
+
onError(
|
|
92
|
+
listener: (error: LinkTrailErrorEvent) => void
|
|
93
|
+
): LinkTrailSubscription {
|
|
94
|
+
return NativeLinkTrail.onError((payload) => {
|
|
95
|
+
listener(payload as unknown as LinkTrailErrorEvent);
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Sends the install event and resolves attribution. Only needed when
|
|
101
|
+
* `autoTrackInstall` is `false` (e.g. deferred until consent) — `configure`
|
|
102
|
+
* does this automatically otherwise. Already-tracked installs resolve from
|
|
103
|
+
* cache unless `force` is `true`.
|
|
104
|
+
*/
|
|
105
|
+
trackInstall(force = false): Promise<LinkTrailAttribution> {
|
|
106
|
+
return NativeLinkTrail.trackInstall(force) as Promise<LinkTrailAttribution>;
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Records a custom post-install event (purchase, signup, conversion).
|
|
111
|
+
* On failure the event is queued natively and retried; the returned promise
|
|
112
|
+
* rejects so you can observe the first failure.
|
|
113
|
+
*/
|
|
114
|
+
trackEvent(
|
|
115
|
+
name: string,
|
|
116
|
+
options: { value?: number; currency?: string } = {}
|
|
117
|
+
): Promise<LinkTrailEventResult> {
|
|
118
|
+
return NativeLinkTrail.trackEvent(
|
|
119
|
+
name,
|
|
120
|
+
options.value,
|
|
121
|
+
options.currency
|
|
122
|
+
) as Promise<LinkTrailEventResult>;
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Forwards an incoming URL to the SDK. Resolves with the resolved deep link,
|
|
127
|
+
* or `null` when the URL is not a LinkTrail link. You only need this when
|
|
128
|
+
* `autoHandleLinks` is `false`; routing normally happens via `onLink`.
|
|
129
|
+
*/
|
|
130
|
+
handleDeepLink(url: string): Promise<LinkTrailDeepLink | null> {
|
|
131
|
+
return NativeLinkTrail.handleDeepLink(
|
|
132
|
+
url
|
|
133
|
+
) as Promise<LinkTrailDeepLink | null>;
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
/** The most recent attribution result (cached across launches), or `null`. */
|
|
137
|
+
getLastAttribution(): Promise<LinkTrailAttribution | null> {
|
|
138
|
+
return NativeLinkTrail.getLastAttribution() as Promise<LinkTrailAttribution | null>;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/** The most recent resolved deep link from the current session, or `null`. */
|
|
142
|
+
getLastDeepLink(): Promise<LinkTrailDeepLink | null> {
|
|
143
|
+
return NativeLinkTrail.getLastDeepLink() as Promise<LinkTrailDeepLink | null>;
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* iOS: requests App Tracking Transparency authorization (for apps using
|
|
148
|
+
* SKAdNetwork) and resolves with whether tracking was granted.
|
|
149
|
+
* Android: resolves `false`.
|
|
150
|
+
*/
|
|
151
|
+
requestTrackingAuthorization(): Promise<boolean> {
|
|
152
|
+
return NativeLinkTrail.requestTrackingAuthorization();
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* iOS: registers the app for SKAdNetwork attribution. Call early in the app
|
|
157
|
+
* lifecycle. Android: no-op.
|
|
158
|
+
*/
|
|
159
|
+
registerForSKAdAttribution(): void {
|
|
160
|
+
NativeLinkTrail.registerForSKAdAttribution();
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* iOS: updates the SKAdNetwork conversion value for a post-install event.
|
|
165
|
+
* Android: no-op.
|
|
166
|
+
*/
|
|
167
|
+
updateConversionValue(
|
|
168
|
+
value: number,
|
|
169
|
+
coarseValue?: LinkTrailCoarseConversionValue
|
|
170
|
+
): void {
|
|
171
|
+
NativeLinkTrail.updateConversionValue(value, coarseValue);
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Clears the install flag, cached attribution, queued events, and device id,
|
|
176
|
+
* so the next launch sends a fresh install event. Testing only.
|
|
177
|
+
*/
|
|
178
|
+
resetForTesting(): void {
|
|
179
|
+
NativeLinkTrail.resetForTesting();
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export default LinkTrail;
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deep-link payload the SDK routes on. Returned by install attribution
|
|
3
|
+
* (deferred deep linking), re-engagement opens, and link resolution.
|
|
4
|
+
*/
|
|
5
|
+
export interface LinkTrailDeepLink {
|
|
6
|
+
/** The link's short slug. */
|
|
7
|
+
slug?: string;
|
|
8
|
+
/** The canonical public URL of the link. */
|
|
9
|
+
url?: string;
|
|
10
|
+
/** The in-app destination path, e.g. `/products/42`. */
|
|
11
|
+
deepLinkPath?: string;
|
|
12
|
+
iosUrl?: string;
|
|
13
|
+
androidUrl?: string;
|
|
14
|
+
fallbackUrl?: string;
|
|
15
|
+
campaign?: string;
|
|
16
|
+
channel?: string;
|
|
17
|
+
/** UTM parameters carried by the link. */
|
|
18
|
+
utm?: Record<string, string>;
|
|
19
|
+
/** Arbitrary key/value payload configured on the link. */
|
|
20
|
+
customData?: Record<string, string>;
|
|
21
|
+
/** The destination path to route to, defaulting to `/` when none is set. */
|
|
22
|
+
path: string;
|
|
23
|
+
/** Whether this link points at a specific destination (not the app root). */
|
|
24
|
+
hasRoutableDestination: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Where a delivered deep link came from. */
|
|
28
|
+
export type LinkTrailLinkSource = 'deferred' | 'reengagement';
|
|
29
|
+
|
|
30
|
+
/** The result of recording an install or open and attributing it. */
|
|
31
|
+
export interface LinkTrailAttribution {
|
|
32
|
+
/** Server-side event id for this install/open. */
|
|
33
|
+
id?: number;
|
|
34
|
+
/** Whether the event was matched to a click. */
|
|
35
|
+
attributed: boolean;
|
|
36
|
+
/** The resolved deep link to route on, when attributed. */
|
|
37
|
+
deepLink?: LinkTrailDeepLink;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The acknowledgement returned when recording a custom event. */
|
|
41
|
+
export interface LinkTrailEventResult {
|
|
42
|
+
id?: number;
|
|
43
|
+
attributed: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** An error reported by the native SDK via the `onError` callback. */
|
|
47
|
+
export interface LinkTrailErrorEvent {
|
|
48
|
+
/**
|
|
49
|
+
* Stable machine-readable code: `missing_api_key`, `invalid_api_key`,
|
|
50
|
+
* `transport`, `server`, `decoding`, `empty_response`, `invalid_url`,
|
|
51
|
+
* `not_a_linktrail_url`, `not_configured`, or `unknown`.
|
|
52
|
+
*/
|
|
53
|
+
code: string;
|
|
54
|
+
/** Human-readable description. */
|
|
55
|
+
message: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Severity levels for SDK logging, from most to least verbose. */
|
|
59
|
+
export type LinkTrailLogLevel = 'debug' | 'info' | 'warning' | 'error' | 'none';
|
|
60
|
+
|
|
61
|
+
/** Retry behavior for transient network failures (timeouts, 5xx, 429). */
|
|
62
|
+
export interface LinkTrailRetryPolicy {
|
|
63
|
+
/** Total attempts including the first try (1 = no retry). Default 3. */
|
|
64
|
+
maxAttempts?: number;
|
|
65
|
+
/** Base delay for exponential backoff, in milliseconds. Default 500. */
|
|
66
|
+
baseDelayMillis?: number;
|
|
67
|
+
/** Upper bound on any single backoff delay, in milliseconds. Default 8000. */
|
|
68
|
+
maxDelayMillis?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Configuration for `LinkTrail.configure(...)`. */
|
|
72
|
+
export interface LinkTrailOptions {
|
|
73
|
+
/** Master switch for native SDK logging. Default `false`. */
|
|
74
|
+
logEnabled?: boolean;
|
|
75
|
+
/** Minimum severity to emit when logging is enabled. Default `'info'`. */
|
|
76
|
+
logLevel?: LinkTrailLogLevel;
|
|
77
|
+
/** Per-request network timeout, in milliseconds. Default 15000. */
|
|
78
|
+
requestTimeoutMillis?: number;
|
|
79
|
+
/** Retry policy applied to transient network failures. */
|
|
80
|
+
retryPolicy?: LinkTrailRetryPolicy;
|
|
81
|
+
/**
|
|
82
|
+
* Link hosts the SDK should treat as its own (e.g. `['go.acme.com']`).
|
|
83
|
+
* When non-empty, `handleDeepLink` ignores URLs on other hosts. Empty =
|
|
84
|
+
* handle every parseable link.
|
|
85
|
+
*/
|
|
86
|
+
linkDomains?: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Whether `configure` automatically sends the install event. Default `true`.
|
|
89
|
+
* Set `false` to defer until consent, then call `trackInstall()` manually.
|
|
90
|
+
*/
|
|
91
|
+
autoTrackInstall?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* React Native-only convenience: when `true` (the default), the wrapper
|
|
94
|
+
* listens to the RN `Linking` API and forwards incoming URLs (including the
|
|
95
|
+
* initial launch URL) to the native SDK, so you don't have to call
|
|
96
|
+
* `handleDeepLink` yourself. Set `false` to forward URLs manually.
|
|
97
|
+
*/
|
|
98
|
+
autoHandleLinks?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** SKAdNetwork 4.0+ coarse conversion value bucket (iOS only). */
|
|
102
|
+
export type LinkTrailCoarseConversionValue = 'low' | 'medium' | 'high';
|
|
103
|
+
|
|
104
|
+
/** A subscription returned by the event-listener APIs. */
|
|
105
|
+
export interface LinkTrailSubscription {
|
|
106
|
+
remove(): void;
|
|
107
|
+
}
|