@advenue/react-native 0.6.5 → 0.6.6
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/dist/index.cjs +4 -32
- package/dist/index.d.cts +1 -11
- package/dist/index.d.ts +1 -11
- package/dist/index.js +4 -31
- package/ios/AdvenueIosModule.swift +0 -11
- package/package.json +2 -2
- package/src/index.ts +3 -36
- package/src/native-types.ts +0 -2
package/dist/index.cjs
CHANGED
|
@@ -63,21 +63,12 @@ __export(index_exports, {
|
|
|
63
63
|
getIosNative: () => getIosNative,
|
|
64
64
|
parseDirectLink: () => parseDirectLink,
|
|
65
65
|
resolveAdvertisingId: () => resolveAdvertisingId,
|
|
66
|
-
resolveClipboardMatch: () => resolveClipboardMatch,
|
|
67
66
|
trackInstall: () => trackInstall
|
|
68
67
|
});
|
|
69
68
|
module.exports = __toCommonJS(index_exports);
|
|
70
69
|
var import_install_referrer = require("@advenue/install-referrer");
|
|
71
70
|
var import_sdk_core = require("@advenue/sdk-core");
|
|
72
71
|
|
|
73
|
-
// ../shared/src/match-token.ts
|
|
74
|
-
var MATCH_TOKEN_PREFIX = "advmatch:";
|
|
75
|
-
function parseMatchToken(raw) {
|
|
76
|
-
if (!raw || !raw.startsWith(MATCH_TOKEN_PREFIX)) return null;
|
|
77
|
-
const id = raw.slice(MATCH_TOKEN_PREFIX.length).trim();
|
|
78
|
-
return /^[A-Za-z0-9_-]{1,128}$/.test(id) ? id : null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
72
|
// ../signing/src/index.ts
|
|
82
73
|
var K = new Uint32Array([
|
|
83
74
|
1116352408,
|
|
@@ -230,7 +221,7 @@ function sha256Hex(message) {
|
|
|
230
221
|
// package.json
|
|
231
222
|
var package_default = {
|
|
232
223
|
name: "@advenue/react-native",
|
|
233
|
-
version: "0.6.
|
|
224
|
+
version: "0.6.6",
|
|
234
225
|
description: "Advenue MMP React Native SDK \u2014 attribution, install tracking, and deep links (bundled iOS/Android Expo native modules)",
|
|
235
226
|
type: "module",
|
|
236
227
|
license: "MIT",
|
|
@@ -466,24 +457,6 @@ function collectDeviceInfo(natives) {
|
|
|
466
457
|
}
|
|
467
458
|
return {};
|
|
468
459
|
}
|
|
469
|
-
async function resolveClipboardMatch() {
|
|
470
|
-
const client = active();
|
|
471
|
-
if (client.getRequireConsent() && !client.getTrackingConsent()) return null;
|
|
472
|
-
const ios = getIosNative();
|
|
473
|
-
if (!ios || typeof ios.getPasteboardMatchToken !== "function") {
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
let token;
|
|
477
|
-
try {
|
|
478
|
-
token = ios.getPasteboardMatchToken();
|
|
479
|
-
} catch (err) {
|
|
480
|
-
reportError("enrich.clipboardMatch", err);
|
|
481
|
-
return null;
|
|
482
|
-
}
|
|
483
|
-
const matchId = parseMatchToken(token);
|
|
484
|
-
if (!matchId) return null;
|
|
485
|
-
return client.exchangeClipboardMatch(matchId);
|
|
486
|
-
}
|
|
487
460
|
function applyAppState(client, status) {
|
|
488
461
|
if (status === "active") {
|
|
489
462
|
client.notifyAppActive();
|
|
@@ -596,9 +569,9 @@ var Advenue = {
|
|
|
596
569
|
deepLinkSub = setupDeepLinks({
|
|
597
570
|
getInitialURL: () => linking.getInitialURL(),
|
|
598
571
|
addUrlListener: (handler) => linking.addEventListener("url", (e) => handler(e.url)),
|
|
599
|
-
// Deferred
|
|
600
|
-
//
|
|
601
|
-
resolveDeferred:
|
|
572
|
+
// Deferred deep link: server-side conversion poll (deterministic ids
|
|
573
|
+
// where available, probabilistic otherwise).
|
|
574
|
+
resolveDeferred: () => client.resolveDeferredDeepLink(),
|
|
602
575
|
onDeepLink
|
|
603
576
|
});
|
|
604
577
|
deepLinkSub.ready.catch((err) => reportError("deepLink.resolve", err));
|
|
@@ -822,6 +795,5 @@ async function trackInstall() {
|
|
|
822
795
|
getIosNative,
|
|
823
796
|
parseDirectLink,
|
|
824
797
|
resolveAdvertisingId,
|
|
825
|
-
resolveClipboardMatch,
|
|
826
798
|
trackInstall
|
|
827
799
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -132,8 +132,6 @@ interface AdvenueIosNativeModule {
|
|
|
132
132
|
getAdvertisingId(): Promise<string | null>;
|
|
133
133
|
/** Vendor-scoped device id (IDFV) — available without ATT; a fallback anchor. */
|
|
134
134
|
getIdentifierForVendor(): string | null;
|
|
135
|
-
/** Clipboard match token (advmatch:<id>) for deterministic deferred deep linking; null if absent. */
|
|
136
|
-
getPasteboardMatchToken(): string | null;
|
|
137
135
|
/**
|
|
138
136
|
* G3.2n — App Attest. Generates (or reuses a keychain-cached) DCAppAttest
|
|
139
137
|
* key, computes clientDataHash = SHA-256(challenge), and calls
|
|
@@ -239,14 +237,6 @@ declare function collectDeviceInfo(natives: {
|
|
|
239
237
|
getDeviceInfo?: () => Partial<DeviceInfo>;
|
|
240
238
|
} | null;
|
|
241
239
|
}): DeviceInfo;
|
|
242
|
-
/**
|
|
243
|
-
* iOS clipboard-match deferred deep linking: reads the `advmatch:<id>` token the
|
|
244
|
-
* link redirector wrote to the pasteboard and exchanges it for the deep link — a
|
|
245
|
-
* DETERMINISTIC match (no IDFA, no fingerprinting). Returns null off iOS, when
|
|
246
|
-
* there's no token, or without consent. (Reading the pasteboard shows the iOS
|
|
247
|
-
* paste banner — the user-visible, privacy-forward deferred path.)
|
|
248
|
-
*/
|
|
249
|
-
declare function resolveClipboardMatch(): Promise<DeepLink | null>;
|
|
250
240
|
interface RNAdvenueConfig extends Omit<AdvenueConfig, 'storage' | 'platform'> {
|
|
251
241
|
/**
|
|
252
242
|
* Auto-detected from React Native's `Platform.OS` — omit it. Pass explicitly
|
|
@@ -343,4 +333,4 @@ declare const Advenue: {
|
|
|
343
333
|
*/
|
|
344
334
|
declare function trackInstall(): Promise<void>;
|
|
345
335
|
|
|
346
|
-
export { Advenue, type AdvenueAndroidNativeModule, type AdvenueDeviceInfo, type AdvenueIosNativeModule, type InstallReferrerResult, type MMKVLike, type MetaInstallReferrerResult, type RNAdvenueConfig, type SecureStoreLike, type TrackingAuthorizationStatus, applyAppState, collectDeviceInfo, createMMKVStorage, createSecureStore, getAndroidNative, getIosNative, parseDirectLink, resolveAdvertisingId,
|
|
336
|
+
export { Advenue, type AdvenueAndroidNativeModule, type AdvenueDeviceInfo, type AdvenueIosNativeModule, type InstallReferrerResult, type MMKVLike, type MetaInstallReferrerResult, type RNAdvenueConfig, type SecureStoreLike, type TrackingAuthorizationStatus, applyAppState, collectDeviceInfo, createMMKVStorage, createSecureStore, getAndroidNative, getIosNative, parseDirectLink, resolveAdvertisingId, trackInstall };
|
package/dist/index.d.ts
CHANGED
|
@@ -132,8 +132,6 @@ interface AdvenueIosNativeModule {
|
|
|
132
132
|
getAdvertisingId(): Promise<string | null>;
|
|
133
133
|
/** Vendor-scoped device id (IDFV) — available without ATT; a fallback anchor. */
|
|
134
134
|
getIdentifierForVendor(): string | null;
|
|
135
|
-
/** Clipboard match token (advmatch:<id>) for deterministic deferred deep linking; null if absent. */
|
|
136
|
-
getPasteboardMatchToken(): string | null;
|
|
137
135
|
/**
|
|
138
136
|
* G3.2n — App Attest. Generates (or reuses a keychain-cached) DCAppAttest
|
|
139
137
|
* key, computes clientDataHash = SHA-256(challenge), and calls
|
|
@@ -239,14 +237,6 @@ declare function collectDeviceInfo(natives: {
|
|
|
239
237
|
getDeviceInfo?: () => Partial<DeviceInfo>;
|
|
240
238
|
} | null;
|
|
241
239
|
}): DeviceInfo;
|
|
242
|
-
/**
|
|
243
|
-
* iOS clipboard-match deferred deep linking: reads the `advmatch:<id>` token the
|
|
244
|
-
* link redirector wrote to the pasteboard and exchanges it for the deep link — a
|
|
245
|
-
* DETERMINISTIC match (no IDFA, no fingerprinting). Returns null off iOS, when
|
|
246
|
-
* there's no token, or without consent. (Reading the pasteboard shows the iOS
|
|
247
|
-
* paste banner — the user-visible, privacy-forward deferred path.)
|
|
248
|
-
*/
|
|
249
|
-
declare function resolveClipboardMatch(): Promise<DeepLink | null>;
|
|
250
240
|
interface RNAdvenueConfig extends Omit<AdvenueConfig, 'storage' | 'platform'> {
|
|
251
241
|
/**
|
|
252
242
|
* Auto-detected from React Native's `Platform.OS` — omit it. Pass explicitly
|
|
@@ -343,4 +333,4 @@ declare const Advenue: {
|
|
|
343
333
|
*/
|
|
344
334
|
declare function trackInstall(): Promise<void>;
|
|
345
335
|
|
|
346
|
-
export { Advenue, type AdvenueAndroidNativeModule, type AdvenueDeviceInfo, type AdvenueIosNativeModule, type InstallReferrerResult, type MMKVLike, type MetaInstallReferrerResult, type RNAdvenueConfig, type SecureStoreLike, type TrackingAuthorizationStatus, applyAppState, collectDeviceInfo, createMMKVStorage, createSecureStore, getAndroidNative, getIosNative, parseDirectLink, resolveAdvertisingId,
|
|
336
|
+
export { Advenue, type AdvenueAndroidNativeModule, type AdvenueDeviceInfo, type AdvenueIosNativeModule, type InstallReferrerResult, type MMKVLike, type MetaInstallReferrerResult, type RNAdvenueConfig, type SecureStoreLike, type TrackingAuthorizationStatus, applyAppState, collectDeviceInfo, createMMKVStorage, createSecureStore, getAndroidNative, getIosNative, parseDirectLink, resolveAdvertisingId, trackInstall };
|
package/dist/index.js
CHANGED
|
@@ -65,14 +65,6 @@ import {
|
|
|
65
65
|
resolveDurableDeviceId
|
|
66
66
|
} from "@advenue/sdk-core";
|
|
67
67
|
|
|
68
|
-
// ../shared/src/match-token.ts
|
|
69
|
-
var MATCH_TOKEN_PREFIX = "advmatch:";
|
|
70
|
-
function parseMatchToken(raw) {
|
|
71
|
-
if (!raw || !raw.startsWith(MATCH_TOKEN_PREFIX)) return null;
|
|
72
|
-
const id = raw.slice(MATCH_TOKEN_PREFIX.length).trim();
|
|
73
|
-
return /^[A-Za-z0-9_-]{1,128}$/.test(id) ? id : null;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
68
|
// ../signing/src/index.ts
|
|
77
69
|
var K = new Uint32Array([
|
|
78
70
|
1116352408,
|
|
@@ -225,7 +217,7 @@ function sha256Hex(message) {
|
|
|
225
217
|
// package.json
|
|
226
218
|
var package_default = {
|
|
227
219
|
name: "@advenue/react-native",
|
|
228
|
-
version: "0.6.
|
|
220
|
+
version: "0.6.6",
|
|
229
221
|
description: "Advenue MMP React Native SDK \u2014 attribution, install tracking, and deep links (bundled iOS/Android Expo native modules)",
|
|
230
222
|
type: "module",
|
|
231
223
|
license: "MIT",
|
|
@@ -461,24 +453,6 @@ function collectDeviceInfo(natives) {
|
|
|
461
453
|
}
|
|
462
454
|
return {};
|
|
463
455
|
}
|
|
464
|
-
async function resolveClipboardMatch() {
|
|
465
|
-
const client = active();
|
|
466
|
-
if (client.getRequireConsent() && !client.getTrackingConsent()) return null;
|
|
467
|
-
const ios = getIosNative();
|
|
468
|
-
if (!ios || typeof ios.getPasteboardMatchToken !== "function") {
|
|
469
|
-
return null;
|
|
470
|
-
}
|
|
471
|
-
let token;
|
|
472
|
-
try {
|
|
473
|
-
token = ios.getPasteboardMatchToken();
|
|
474
|
-
} catch (err) {
|
|
475
|
-
reportError("enrich.clipboardMatch", err);
|
|
476
|
-
return null;
|
|
477
|
-
}
|
|
478
|
-
const matchId = parseMatchToken(token);
|
|
479
|
-
if (!matchId) return null;
|
|
480
|
-
return client.exchangeClipboardMatch(matchId);
|
|
481
|
-
}
|
|
482
456
|
function applyAppState(client, status) {
|
|
483
457
|
if (status === "active") {
|
|
484
458
|
client.notifyAppActive();
|
|
@@ -591,9 +565,9 @@ var Advenue = {
|
|
|
591
565
|
deepLinkSub = setupDeepLinks({
|
|
592
566
|
getInitialURL: () => linking.getInitialURL(),
|
|
593
567
|
addUrlListener: (handler) => linking.addEventListener("url", (e) => handler(e.url)),
|
|
594
|
-
// Deferred
|
|
595
|
-
//
|
|
596
|
-
resolveDeferred:
|
|
568
|
+
// Deferred deep link: server-side conversion poll (deterministic ids
|
|
569
|
+
// where available, probabilistic otherwise).
|
|
570
|
+
resolveDeferred: () => client.resolveDeferredDeepLink(),
|
|
597
571
|
onDeepLink
|
|
598
572
|
});
|
|
599
573
|
deepLinkSub.ready.catch((err) => reportError("deepLink.resolve", err));
|
|
@@ -816,6 +790,5 @@ export {
|
|
|
816
790
|
getIosNative,
|
|
817
791
|
parseDirectLink,
|
|
818
792
|
resolveAdvertisingId,
|
|
819
|
-
resolveClipboardMatch,
|
|
820
793
|
trackInstall
|
|
821
794
|
};
|
|
@@ -137,17 +137,6 @@ public class AdvenueIosModule: Module {
|
|
|
137
137
|
return Self.onMainSync { UIDevice.current.identifierForVendor?.uuidString }
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
// Reads our clipboard match token (advmatch:<id>) written by the link
|
|
141
|
-
// redirector, for deterministic deferred deep linking. Returns ONLY our
|
|
142
|
-
// token, never arbitrary clipboard contents. (Reading the pasteboard shows
|
|
143
|
-
// the iOS paste notification — expected, user-visible, deterministic path.)
|
|
144
|
-
Function("getPasteboardMatchToken") { () -> String? in
|
|
145
|
-
return Self.onMainSync { () -> String? in
|
|
146
|
-
guard let s = UIPasteboard.general.string, s.hasPrefix("advmatch:") else { return nil }
|
|
147
|
-
return s
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
140
|
// G3.3 — DeviceCheck token. Calls DCDevice.current.generateToken to obtain
|
|
152
141
|
// the opaque base64 token that identifies this physical device to the Apple
|
|
153
142
|
// DeviceCheck API. The server uses it (with the per-app DeviceCheck key) to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@advenue/react-native",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Advenue MMP React Native SDK — attribution, install tracking, and deep links (bundled iOS/Android Expo native modules)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@advenue/install-referrer": "0.
|
|
32
|
+
"@advenue/install-referrer": "0.3.0",
|
|
33
33
|
"@advenue/sdk-core": "0.4.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
type TrackOptions,
|
|
18
18
|
resolveDurableDeviceId,
|
|
19
19
|
} from '@advenue/sdk-core';
|
|
20
|
-
import { parseMatchToken } from '@advenue/shared/match-token';
|
|
21
20
|
import { sha256Hex } from '@advenue/signing';
|
|
22
21
|
import pkg from '../package.json' with { type: 'json' };
|
|
23
22
|
import { type DeepLinkHandle, setupDeepLinks } from './deep-links';
|
|
@@ -149,37 +148,6 @@ export function collectDeviceInfo(natives: {
|
|
|
149
148
|
return {};
|
|
150
149
|
}
|
|
151
150
|
|
|
152
|
-
/**
|
|
153
|
-
* iOS clipboard-match deferred deep linking: reads the `advmatch:<id>` token the
|
|
154
|
-
* link redirector wrote to the pasteboard and exchanges it for the deep link — a
|
|
155
|
-
* DETERMINISTIC match (no IDFA, no fingerprinting). Returns null off iOS, when
|
|
156
|
-
* there's no token, or without consent. (Reading the pasteboard shows the iOS
|
|
157
|
-
* paste banner — the user-visible, privacy-forward deferred path.)
|
|
158
|
-
*/
|
|
159
|
-
export async function resolveClipboardMatch(): Promise<DeepLink | null> {
|
|
160
|
-
const client = active();
|
|
161
|
-
if (client.getRequireConsent() && !client.getTrackingConsent()) return null;
|
|
162
|
-
const ios = getIosNative();
|
|
163
|
-
if (
|
|
164
|
-
!ios ||
|
|
165
|
-
typeof (ios as { getPasteboardMatchToken?: unknown }).getPasteboardMatchToken !== 'function'
|
|
166
|
-
) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
let token: string | null;
|
|
170
|
-
try {
|
|
171
|
-
token = ios.getPasteboardMatchToken();
|
|
172
|
-
} catch (err) {
|
|
173
|
-
// Native pasteboard read failed (bridge error, MDM restriction) — deferred
|
|
174
|
-
// resolution falls through to the server-side conversion poll.
|
|
175
|
-
reportError('enrich.clipboardMatch', err);
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
const matchId = parseMatchToken(token);
|
|
179
|
-
if (!matchId) return null;
|
|
180
|
-
return client.exchangeClipboardMatch(matchId);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
151
|
export interface RNAdvenueConfig extends Omit<AdvenueConfig, 'storage' | 'platform'> {
|
|
184
152
|
/**
|
|
185
153
|
* Auto-detected from React Native's `Platform.OS` — omit it. Pass explicitly
|
|
@@ -421,10 +389,9 @@ export const Advenue = {
|
|
|
421
389
|
deepLinkSub = setupDeepLinks({
|
|
422
390
|
getInitialURL: () => linking.getInitialURL(),
|
|
423
391
|
addUrlListener: (handler) => linking.addEventListener('url', (e) => handler(e.url)),
|
|
424
|
-
// Deferred
|
|
425
|
-
//
|
|
426
|
-
resolveDeferred:
|
|
427
|
-
(await resolveClipboardMatch()) ?? client.resolveDeferredDeepLink(),
|
|
392
|
+
// Deferred deep link: server-side conversion poll (deterministic ids
|
|
393
|
+
// where available, probabilistic otherwise).
|
|
394
|
+
resolveDeferred: () => client.resolveDeferredDeepLink(),
|
|
428
395
|
onDeepLink,
|
|
429
396
|
});
|
|
430
397
|
// Cold-start resolution is fire-and-forget: a failure (Linking or the
|
package/src/native-types.ts
CHANGED
|
@@ -123,8 +123,6 @@ export interface AdvenueIosNativeModule {
|
|
|
123
123
|
getAdvertisingId(): Promise<string | null>;
|
|
124
124
|
/** Vendor-scoped device id (IDFV) — available without ATT; a fallback anchor. */
|
|
125
125
|
getIdentifierForVendor(): string | null;
|
|
126
|
-
/** Clipboard match token (advmatch:<id>) for deterministic deferred deep linking; null if absent. */
|
|
127
|
-
getPasteboardMatchToken(): string | null;
|
|
128
126
|
/**
|
|
129
127
|
* G3.2n — App Attest. Generates (or reuses a keychain-cached) DCAppAttest
|
|
130
128
|
* key, computes clientDataHash = SHA-256(challenge), and calls
|