@kerdly/expo 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +235 -2
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +19 -0
- package/android/src/main/java/com/kerdly/expo/KerdlySdkModule.kt +326 -0
- package/android/vendor/kerdly-sdk/.kerdly-sync.json +8 -0
- package/android/vendor/kerdly-sdk/consumer-rules.pro +15 -0
- package/android/vendor/kerdly-sdk/kerdly-sdk.properties +2 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/Kerdly.kt +343 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/KerdlyTypes.kt +89 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Attribution.kt +39 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Batch.kt +159 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Core.kt +991 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/DeepLinks.kt +114 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/DeferredLinks.kt +111 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/DeviceContext.kt +137 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/EventQueue.kt +135 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Events.kt +314 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Json.kt +116 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Logger.kt +49 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Options.kt +47 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Ports.kt +83 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/PublicIp.kt +120 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Referrers.kt +137 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/RemoteConfig.kt +100 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/Storage.kt +271 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/android/AndroidPlatform.kt +274 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/android/AndroidRuntime.kt +187 -0
- package/android/vendor/kerdly-sdk/kotlin/com/kerdly/sdk/internal/android/PlayReferrerReader.kt +97 -0
- package/app.plugin.js +2 -0
- package/build/Kerdly.d.ts +106 -0
- package/build/Kerdly.d.ts.map +1 -0
- package/build/Kerdly.js +494 -0
- package/build/Kerdly.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -0
- package/build/log.d.ts +13 -0
- package/build/log.d.ts.map +1 -0
- package/build/log.js +45 -0
- package/build/log.js.map +1 -0
- package/build/native.d.ts +74 -0
- package/build/native.d.ts.map +1 -0
- package/build/native.js +56 -0
- package/build/native.js.map +1 -0
- package/build/normalize.d.ts +8 -0
- package/build/normalize.d.ts.map +1 -0
- package/build/normalize.js +86 -0
- package/build/normalize.js.map +1 -0
- package/build/types.d.ts +134 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/build/validation.d.ts +70 -0
- package/build/validation.d.ts.map +1 -0
- package/build/validation.js +349 -0
- package/build/validation.js.map +1 -0
- package/build/version.d.ts +4 -0
- package/build/version.d.ts.map +1 -0
- package/build/version.js +5 -0
- package/build/version.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/KerdlySDK/.kerdly-sync.json +7 -0
- package/ios/KerdlySDK/Core/Dependencies.swift +163 -0
- package/ios/KerdlySDK/Core/KerdlyCore+API.swift +117 -0
- package/ios/KerdlySDK/Core/KerdlyCore+Collectors.swift +410 -0
- package/ios/KerdlySDK/Core/KerdlyCore+DeferredLinks.swift +220 -0
- package/ios/KerdlySDK/Core/KerdlyCore+Delivery.swift +424 -0
- package/ios/KerdlySDK/Core/KerdlyCore.swift +557 -0
- package/ios/KerdlySDK/Core/Support.swift +95 -0
- package/ios/KerdlySDK/Logic/Backoff.swift +22 -0
- package/ios/KerdlySDK/Logic/Batch.swift +180 -0
- package/ios/KerdlySDK/Logic/Context.swift +85 -0
- package/ios/KerdlySDK/Logic/DeepLinks.swift +93 -0
- package/ios/KerdlySDK/Logic/DeferredLinks.swift +239 -0
- package/ios/KerdlySDK/Logic/Environment.swift +39 -0
- package/ios/KerdlySDK/Logic/EventQueue.swift +85 -0
- package/ios/KerdlySDK/Logic/EventValidator.swift +84 -0
- package/ios/KerdlySDK/Logic/Events.swift +102 -0
- package/ios/KerdlySDK/Logic/IPv6Address.swift +26 -0
- package/ios/KerdlySDK/Logic/InstallIdentity.swift +106 -0
- package/ios/KerdlySDK/Logic/JSONValue.swift +198 -0
- package/ios/KerdlySDK/Logic/Purchases.swift +84 -0
- package/ios/KerdlySDK/Logic/RemoteConfig.swift +185 -0
- package/ios/KerdlySDK/Logic/Skan.swift +343 -0
- package/ios/KerdlySDK/Logic/StandardEvents.swift +126 -0
- package/ios/KerdlySDK/Platform/AdSignals.swift +19 -0
- package/ios/KerdlySDK/Platform/DeferredLinkBundle.swift +25 -0
- package/ios/KerdlySDK/Platform/DeviceInfo.swift +82 -0
- package/ios/KerdlySDK/Platform/Lifecycle.swift +74 -0
- package/ios/KerdlySDK/Platform/PublicIp.swift +33 -0
- package/ios/KerdlySDK/Platform/SkanWriter.swift +70 -0
- package/ios/KerdlySDK/Platform/StoreKitAdapter.swift +185 -0
- package/ios/KerdlySDK/Platform/SystemStores.swift +200 -0
- package/ios/KerdlySDK/Platform/Tracking.swift +124 -0
- package/ios/KerdlySDK/Public/Kerdly.swift +202 -0
- package/ios/KerdlySDK/Public/KerdlyTypes.swift +130 -0
- package/ios/KerdlySDK/Resources/PrivacyInfo.xcprivacy +95 -0
- package/ios/KerdlySDK/Storage/PersistedState.swift +175 -0
- package/ios/KerdlySDK/Storage/StateStore.swift +36 -0
- package/ios/KerdlySdk.podspec +45 -0
- package/ios/KerdlySdkModule.swift +332 -0
- package/package.json +92 -4
- package/plugin/withKerdly.js +163 -0
- package/src/Kerdly.ts +524 -0
- package/src/index.ts +23 -0
- package/src/log.ts +49 -0
- package/src/native.ts +150 -0
- package/src/normalize.ts +82 -0
- package/src/types.ts +183 -0
- package/src/validation.ts +343 -0
- package/src/version.ts +5 -0
package/build/Kerdly.js
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { Linking, Platform } from 'react-native';
|
|
2
|
+
import { devError, devWarn, isLogLevel, setLogLevel } from './log';
|
|
3
|
+
import { ATTRIBUTION_EVENT, callNative, getNativeModule } from './native';
|
|
4
|
+
import { normalizeAttribution, normalizeDeepLink } from './normalize';
|
|
5
|
+
import { isUuid, sanitizeNetworkSend, sanitizePartnerIds, sanitizePurchase, validateEvent, validateStandardEvent, } from './validation';
|
|
6
|
+
import { WRAPPER } from './version';
|
|
7
|
+
// Every public function is total: it validates its input, never throws, and its promise never
|
|
8
|
+
// rejects. Calls go straight to the native SDK, which holds calls made before `configure` and runs
|
|
9
|
+
// them after it. The only behaviour of this layer is the automatic deep-link capture.
|
|
10
|
+
const ENVIRONMENTS = ['auto', 'production', 'sandbox', 'development'];
|
|
11
|
+
const ATT_STATUSES = [
|
|
12
|
+
'authorized',
|
|
13
|
+
'denied',
|
|
14
|
+
'restricted',
|
|
15
|
+
'not_determined',
|
|
16
|
+
'not_applicable',
|
|
17
|
+
];
|
|
18
|
+
const NOOP_SUBSCRIPTION = { remove() { } };
|
|
19
|
+
// Deep-link capture: one `url` subscription, and one read of the initial URL per JS runtime.
|
|
20
|
+
let urlSubscription = null;
|
|
21
|
+
let initialUrlRequested = false;
|
|
22
|
+
function warnProblems(context, problems) {
|
|
23
|
+
if (problems.length > 0)
|
|
24
|
+
devWarn(`${context}: ${problems.join('; ')}`);
|
|
25
|
+
}
|
|
26
|
+
function shown(value) {
|
|
27
|
+
try {
|
|
28
|
+
return typeof value === 'string' ? JSON.stringify(value) : String(value);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return typeof value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// expo-dev-client opens the app with `<scheme>://expo-development-client/?url=<dev server>`;
|
|
35
|
+
// that is the development server, not a deep link.
|
|
36
|
+
function isDevLauncherUrl(url) {
|
|
37
|
+
return /^[a-z][a-z0-9+.-]*:\/\/expo-development-client(?:[/?#]|$)/i.test(url);
|
|
38
|
+
}
|
|
39
|
+
function forwardUrl(url, source) {
|
|
40
|
+
if (typeof url !== 'string' || url.length === 0 || isDevLauncherUrl(url))
|
|
41
|
+
return;
|
|
42
|
+
void callNative('handleUrl', url, source);
|
|
43
|
+
}
|
|
44
|
+
function setDeepLinkCapture(enabled) {
|
|
45
|
+
if (!enabled) {
|
|
46
|
+
if (urlSubscription) {
|
|
47
|
+
try {
|
|
48
|
+
urlSubscription.remove();
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
devWarn('Removing the Linking url listener failed:', error);
|
|
52
|
+
}
|
|
53
|
+
urlSubscription = null;
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (!urlSubscription) {
|
|
58
|
+
try {
|
|
59
|
+
urlSubscription = Linking.addEventListener('url', (event) => forwardUrl(event?.url, 'runtime'));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
devWarn('Could not subscribe to Linking url events:', error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!initialUrlRequested) {
|
|
66
|
+
initialUrlRequested = true;
|
|
67
|
+
try {
|
|
68
|
+
Promise.resolve(Linking.getInitialURL()).then((url) => forwardUrl(url, 'initial'), (error) => devWarn('Linking.getInitialURL failed:', error));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
devWarn('Linking.getInitialURL failed:', error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Starts the native SDK. Call it once, as early as possible (module scope of the root component).
|
|
77
|
+
* Resolves when the native `configure` has run; never rejects.
|
|
78
|
+
*/
|
|
79
|
+
/** The Kerdly collector, used when `endpoint` is not given. */
|
|
80
|
+
export const DEFAULT_ENDPOINT = 'https://app.kerdly.com/api';
|
|
81
|
+
async function configure(options) {
|
|
82
|
+
try {
|
|
83
|
+
if (options === null || typeof options !== 'object') {
|
|
84
|
+
devWarn('configure: an options object with `key` is required; ignored');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const { key } = options;
|
|
88
|
+
const endpoint = options.endpoint === undefined ? DEFAULT_ENDPOINT : options.endpoint;
|
|
89
|
+
if (typeof key !== 'string' || key.length === 0) {
|
|
90
|
+
devWarn('configure: `key` (pk_live_… / pk_test_…) is required; ignored');
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (typeof endpoint !== 'string' || endpoint.length === 0) {
|
|
94
|
+
devWarn('configure: `endpoint` must be the collector base URL; ignored');
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (key.startsWith('sk_')) {
|
|
98
|
+
devError('configure: that is a server key (sk_…); apps take their public pk_ key. The SDK stays off');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!/^pk_(live|test)_/.test(key)) {
|
|
102
|
+
devWarn('configure: `key` should be the app public key (pk_live_… / pk_test_…)');
|
|
103
|
+
}
|
|
104
|
+
let logLevel = options.logLevel ?? 'warn';
|
|
105
|
+
if (!isLogLevel(logLevel)) {
|
|
106
|
+
devWarn(`configure: unknown logLevel ${shown(logLevel)}; using "warn"`);
|
|
107
|
+
logLevel = 'warn';
|
|
108
|
+
}
|
|
109
|
+
setLogLevel(logLevel);
|
|
110
|
+
let environment = options.environment ?? 'auto';
|
|
111
|
+
if (!ENVIRONMENTS.includes(environment)) {
|
|
112
|
+
devWarn(`configure: unknown environment ${shown(environment)}; using "auto"`);
|
|
113
|
+
environment = 'auto';
|
|
114
|
+
}
|
|
115
|
+
const nativeOptions = {
|
|
116
|
+
key,
|
|
117
|
+
endpoint,
|
|
118
|
+
environment,
|
|
119
|
+
collectAdvertisingId: options.collectAdvertisingId !== false,
|
|
120
|
+
skanWriter: options.skanWriter === true,
|
|
121
|
+
logLevel,
|
|
122
|
+
wrapper: WRAPPER,
|
|
123
|
+
};
|
|
124
|
+
if (typeof options.metaAppId === 'string' && options.metaAppId.length > 0) {
|
|
125
|
+
nativeOptions.metaAppId = options.metaAppId;
|
|
126
|
+
}
|
|
127
|
+
if (!getNativeModule())
|
|
128
|
+
return;
|
|
129
|
+
// Native calls run in call order, so URLs forwarded below reach a configured SDK.
|
|
130
|
+
const configured = callNative('configure', nativeOptions);
|
|
131
|
+
setDeepLinkCapture(options.autoDeepLinks !== false);
|
|
132
|
+
await configured;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
devWarn('configure failed:', error);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Sets (or, with `null`, clears) the app's user id; attached to every later event. */
|
|
139
|
+
function setUserId(userId) {
|
|
140
|
+
try {
|
|
141
|
+
if (userId === null || userId === undefined) {
|
|
142
|
+
void callNative('setUserId', null);
|
|
143
|
+
}
|
|
144
|
+
else if (typeof userId === 'string' && userId.length > 0) {
|
|
145
|
+
void callNative('setUserId', userId);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
devWarn(`setUserId: expected a non-empty string or null, got ${shown(userId)}; ignored`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
devWarn('setUserId failed:', error);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** Records a custom event. Invalid names drop the event, invalid props are dropped. */
|
|
156
|
+
function track(name, properties) {
|
|
157
|
+
try {
|
|
158
|
+
const { event, problems } = validateEvent(name, properties);
|
|
159
|
+
if (!event) {
|
|
160
|
+
warnProblems('track: event dropped', problems);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
warnProblems(`track(${shown(event.name)}): dropped`, problems);
|
|
164
|
+
void callNative('track', event.name, event.properties);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
devWarn('track failed:', error);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Standard events: a malformed typed field is dropped, never the event.
|
|
171
|
+
function validStandardEvent(method, input) {
|
|
172
|
+
const { event, problems } = validateStandardEvent(method, input);
|
|
173
|
+
warnProblems(event ? `${method}: dropped` : `${method}: event dropped`, problems);
|
|
174
|
+
return event;
|
|
175
|
+
}
|
|
176
|
+
/** Records `registration`: the user signed up (`method`: `anonymous`, `apple`, `google`, `email`, …). */
|
|
177
|
+
function trackRegistration(event) {
|
|
178
|
+
try {
|
|
179
|
+
const clean = validStandardEvent('trackRegistration', event);
|
|
180
|
+
if (!clean)
|
|
181
|
+
return;
|
|
182
|
+
void callNative('trackRegistration', clean.fields.method, clean.properties);
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
devWarn('trackRegistration failed:', error);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Records `start_trial`. `value` is what the user paid (0 for a free trial) and needs `currency`. */
|
|
189
|
+
function trackStartTrial(event) {
|
|
190
|
+
try {
|
|
191
|
+
const clean = validStandardEvent('trackStartTrial', event);
|
|
192
|
+
if (!clean)
|
|
193
|
+
return;
|
|
194
|
+
const { productId, value, currency, transactionId } = clean.fields;
|
|
195
|
+
void callNative('trackStartTrial', productId, value, currency, transactionId, clean.properties);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
devWarn('trackStartTrial failed:', error);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Records `subscribe`: the first paid period started. `value` needs `currency`. */
|
|
202
|
+
function trackSubscribe(event) {
|
|
203
|
+
try {
|
|
204
|
+
const clean = validStandardEvent('trackSubscribe', event);
|
|
205
|
+
if (!clean)
|
|
206
|
+
return;
|
|
207
|
+
const { productId, value, currency, transactionId } = clean.fields;
|
|
208
|
+
void callNative('trackSubscribe', productId, value, currency, transactionId, clean.properties);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
devWarn('trackSubscribe failed:', error);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** Records `purchase`: a one-time purchase. `value` needs `currency`; `quantity` is an integer ≥ 1. */
|
|
215
|
+
function trackPurchase(event) {
|
|
216
|
+
try {
|
|
217
|
+
const clean = validStandardEvent('trackPurchase', event);
|
|
218
|
+
if (!clean)
|
|
219
|
+
return;
|
|
220
|
+
const { productId, value, currency, quantity, transactionId } = clean.fields;
|
|
221
|
+
void callNative('trackPurchase', productId, value, currency, quantity, transactionId, clean.properties);
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
devWarn('trackPurchase failed:', error);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** Updates consent flags; an omitted flag keeps its current value. */
|
|
228
|
+
function setConsent(consent) {
|
|
229
|
+
try {
|
|
230
|
+
if (consent === null || typeof consent !== 'object') {
|
|
231
|
+
devWarn('setConsent: expected { analytics?: boolean, ads?: boolean }; ignored');
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const flag = (name) => {
|
|
235
|
+
const value = consent[name];
|
|
236
|
+
if (value === undefined || value === null)
|
|
237
|
+
return null;
|
|
238
|
+
if (typeof value === 'boolean')
|
|
239
|
+
return value;
|
|
240
|
+
devWarn(`setConsent: \`${name}\` must be a boolean, got ${shown(value)}; ignored`);
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
const analytics = flag('analytics');
|
|
244
|
+
const ads = flag('ads');
|
|
245
|
+
if (analytics === null && ads === null) {
|
|
246
|
+
devWarn('setConsent: neither `analytics` nor `ads` was given; nothing to change');
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
void callNative('setConsent', analytics, ads);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
devWarn('setConsent failed:', error);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Hands a deep link to the native SDK (which records `$deeplink`) and returns what it parsed.
|
|
257
|
+
* With `autoDeepLinks` on (the default) Linking URLs are already forwarded: use this only for
|
|
258
|
+
* URLs that do not arrive through React Native's `Linking`.
|
|
259
|
+
*/
|
|
260
|
+
async function handleUrl(url) {
|
|
261
|
+
try {
|
|
262
|
+
if (typeof url !== 'string' || url.length === 0) {
|
|
263
|
+
devWarn(`handleUrl: expected a URL string, got ${shown(url)}`);
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
return normalizeDeepLink(await callNative('handleUrl', url, null));
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
devWarn('handleUrl failed:', error);
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Sets (or, with `null`, clears) the account token the app's purchases carry. iOS: the StoreKit
|
|
275
|
+
* `appAccountToken` UUID. Android: the Play `obfuscatedAccountId` (a UUID, or Superwall's
|
|
276
|
+
* `$SuperwallAlias:<uuid>` before identify).
|
|
277
|
+
*/
|
|
278
|
+
function setAppAccountToken(token) {
|
|
279
|
+
try {
|
|
280
|
+
if (token === null || token === undefined) {
|
|
281
|
+
void callNative('setAppAccountToken', null);
|
|
282
|
+
}
|
|
283
|
+
else if (typeof token !== 'string' || token.trim().length === 0) {
|
|
284
|
+
devWarn(`setAppAccountToken: expected a token string or null, got ${shown(token)}; ignored`);
|
|
285
|
+
}
|
|
286
|
+
else if (Platform.OS === 'ios' && !isUuid(token)) {
|
|
287
|
+
devWarn(`setAppAccountToken: iOS takes the StoreKit appAccountToken UUID, got ${shown(token)}; ignored`);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
void callNative('setAppAccountToken', token);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
devWarn('setAppAccountToken failed:', error);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/** Ids of other SDKs (e.g. `meta_anon_id`, `superwall_alias`) for the collector to join on. */
|
|
298
|
+
function setPartnerIds(ids) {
|
|
299
|
+
try {
|
|
300
|
+
const { ids: clean, problems } = sanitizePartnerIds(ids);
|
|
301
|
+
warnProblems('setPartnerIds: ignored', problems);
|
|
302
|
+
if (!clean)
|
|
303
|
+
return;
|
|
304
|
+
if (Object.keys(clean).length === 0 && problems.length > 0)
|
|
305
|
+
return;
|
|
306
|
+
void callNative('setPartnerIds', clean);
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
devWarn('setPartnerIds failed:', error);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Links a store purchase to this install (`$purchase_link`, once per transaction / token).
|
|
314
|
+
* Accepts the iOS or the Android shape. On iOS, calling it without a purchase sweeps
|
|
315
|
+
* `Transaction.currentEntitlements`; Android needs `purchaseToken`.
|
|
316
|
+
*/
|
|
317
|
+
function notifyPurchase(purchase) {
|
|
318
|
+
try {
|
|
319
|
+
const { purchase: clean, problems } = sanitizePurchase(purchase);
|
|
320
|
+
warnProblems('notifyPurchase: ignored', problems);
|
|
321
|
+
if (purchase !== undefined && purchase !== null && clean === null)
|
|
322
|
+
return;
|
|
323
|
+
if (Platform.OS === 'android' && !clean?.purchaseToken) {
|
|
324
|
+
devWarn('notifyPurchase: Android needs the purchase `purchaseToken`; ignored');
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
void callNative('notifyPurchase', clean);
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
devWarn('notifyPurchase failed:', error);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** Records a conversion the app sent to an ad network itself (`$network_send`). */
|
|
334
|
+
function recordNetworkSend(send) {
|
|
335
|
+
try {
|
|
336
|
+
const { send: clean, problems } = sanitizeNetworkSend(send);
|
|
337
|
+
warnProblems('recordNetworkSend: ignored', problems);
|
|
338
|
+
if (!clean)
|
|
339
|
+
return;
|
|
340
|
+
void callNative('recordNetworkSend', clean);
|
|
341
|
+
}
|
|
342
|
+
catch (error) {
|
|
343
|
+
devWarn('recordNetworkSend failed:', error);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/** The cached attribution, or `null` until the collector has decided one. */
|
|
347
|
+
async function getAttribution() {
|
|
348
|
+
try {
|
|
349
|
+
return normalizeAttribution(await callNative('getAttribution'));
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
devWarn('getAttribution failed:', error);
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Calls `listener` with the current attribution at once (when already known) and whenever the
|
|
358
|
+
* native SDK reports a new one, like the native `Kerdly.onAttribution`.
|
|
359
|
+
*/
|
|
360
|
+
function addAttributionListener(listener) {
|
|
361
|
+
try {
|
|
362
|
+
if (typeof listener !== 'function') {
|
|
363
|
+
devWarn('addAttributionListener: listener must be a function');
|
|
364
|
+
return NOOP_SUBSCRIPTION;
|
|
365
|
+
}
|
|
366
|
+
const native = getNativeModule();
|
|
367
|
+
if (!native || typeof native.addListener !== 'function')
|
|
368
|
+
return NOOP_SUBSCRIPTION;
|
|
369
|
+
let removed = false;
|
|
370
|
+
let delivered = false;
|
|
371
|
+
const deliver = (attribution) => {
|
|
372
|
+
delivered = true;
|
|
373
|
+
try {
|
|
374
|
+
listener(attribution);
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
devError('An attribution listener threw:', error);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const subscription = native.addListener(ATTRIBUTION_EVENT, (payload) => {
|
|
381
|
+
const attribution = normalizeAttribution(payload);
|
|
382
|
+
if (attribution)
|
|
383
|
+
deliver(attribution);
|
|
384
|
+
else
|
|
385
|
+
devWarn('Ignored a malformed onAttribution event:', payload);
|
|
386
|
+
});
|
|
387
|
+
// The native handler is registered once per process, so its "at once" call happened before
|
|
388
|
+
// this listener existed; replay the cached value unless an event got here first.
|
|
389
|
+
void callNative('getAttribution').then((payload) => {
|
|
390
|
+
if (removed || delivered)
|
|
391
|
+
return;
|
|
392
|
+
const attribution = normalizeAttribution(payload);
|
|
393
|
+
if (attribution)
|
|
394
|
+
deliver(attribution);
|
|
395
|
+
});
|
|
396
|
+
return {
|
|
397
|
+
remove() {
|
|
398
|
+
if (removed)
|
|
399
|
+
return;
|
|
400
|
+
removed = true;
|
|
401
|
+
try {
|
|
402
|
+
subscription?.remove();
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
devWarn('Removing the attribution listener failed:', error);
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
devWarn('addAttributionListener failed:', error);
|
|
412
|
+
return NOOP_SUBSCRIPTION;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* iOS: shows the App Tracking Transparency prompt (needs `NSUserTrackingUsageDescription`, which
|
|
417
|
+
* the config plugin's `userTrackingPermission` sets) and resolves the resulting status.
|
|
418
|
+
* Android: resolves `not_applicable`.
|
|
419
|
+
*/
|
|
420
|
+
async function requestTrackingAuthorization() {
|
|
421
|
+
try {
|
|
422
|
+
if (Platform.OS !== 'ios')
|
|
423
|
+
return 'not_applicable';
|
|
424
|
+
const status = await callNative('requestTrackingAuthorization');
|
|
425
|
+
return typeof status === 'string' && ATT_STATUSES.includes(status)
|
|
426
|
+
? status
|
|
427
|
+
: 'not_determined';
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
devWarn('requestTrackingAuthorization failed:', error);
|
|
431
|
+
return 'not_determined';
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/** Asks the native SDK to send its queue now. Resolves once the request is handed over. */
|
|
435
|
+
async function flush() {
|
|
436
|
+
try {
|
|
437
|
+
await callNative('flush');
|
|
438
|
+
}
|
|
439
|
+
catch (error) {
|
|
440
|
+
devWarn('flush failed:', error);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
/** The install id (a lowercase UUID), or `null` before the first `configure`. */
|
|
444
|
+
async function getInstallId() {
|
|
445
|
+
try {
|
|
446
|
+
const id = await callNative('getInstallId');
|
|
447
|
+
return typeof id === 'string' && id.length > 0 ? id : null;
|
|
448
|
+
}
|
|
449
|
+
catch (error) {
|
|
450
|
+
devWarn('getInstallId failed:', error);
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Debug builds only (iOS): asks Meta (ids from the app's Facebook config) and TikTok
|
|
456
|
+
* (`tiktokAppId`) for this device's deferred deep link and resolves each network's raw answer.
|
|
457
|
+
* Sends nothing to Kerdly. Asks only when the `ads` consent is on and tracking is authorized. In a
|
|
458
|
+
* release build it asks nothing and every answer is `error` ("debug builds only"). Android
|
|
459
|
+
* resolves `[]`.
|
|
460
|
+
*/
|
|
461
|
+
async function debugFetchDeferredLinks(options = {}) {
|
|
462
|
+
try {
|
|
463
|
+
if (Platform.OS !== 'ios')
|
|
464
|
+
return [];
|
|
465
|
+
const answers = await callNative('debugFetchDeferredLinks', options.tiktokAppId ?? null, options.storeAppId ?? null);
|
|
466
|
+
return Array.isArray(answers) ? answers : [];
|
|
467
|
+
}
|
|
468
|
+
catch (error) {
|
|
469
|
+
devWarn('debugFetchDeferredLinks failed:', error);
|
|
470
|
+
return [];
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
export const Kerdly = {
|
|
474
|
+
configure,
|
|
475
|
+
setUserId,
|
|
476
|
+
track,
|
|
477
|
+
trackRegistration,
|
|
478
|
+
trackStartTrial,
|
|
479
|
+
trackSubscribe,
|
|
480
|
+
trackPurchase,
|
|
481
|
+
setConsent,
|
|
482
|
+
handleUrl,
|
|
483
|
+
setAppAccountToken,
|
|
484
|
+
setPartnerIds,
|
|
485
|
+
notifyPurchase,
|
|
486
|
+
recordNetworkSend,
|
|
487
|
+
getAttribution,
|
|
488
|
+
addAttributionListener,
|
|
489
|
+
requestTrackingAuthorization,
|
|
490
|
+
flush,
|
|
491
|
+
getInstallId,
|
|
492
|
+
debugFetchDeferredLinks,
|
|
493
|
+
};
|
|
494
|
+
//# sourceMappingURL=Kerdly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kerdly.js","sourceRoot":"","sources":["../src/Kerdly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAA+B,MAAM,UAAU,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAkBtE,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,qBAAqB,GAGtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8FAA8F;AAC9F,mGAAmG;AACnG,sFAAsF;AAEtF,MAAM,YAAY,GAAiC,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AACpG,MAAM,YAAY,GAA+B;IAC/C,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;CACjB,CAAC;AAEF,MAAM,iB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OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS;IACT,SAAS;IACT,KAAK;IACL,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,aAAa;IACb,UAAU;IACV,SAAS;IACT,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd,sBAAsB;IACtB,4BAA4B;IAC5B,KAAK;IACL,YAAY;IACZ,uBAAuB;CACxB,CAAC"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_ENDPOINT, Kerdly } from './Kerdly';
|
|
2
|
+
export type { KerdlyApi, KerdlyDeferredLinkAnswer } from './Kerdly';
|
|
3
|
+
export type { KerdlyAndroidPurchase, KerdlyAttStatus, KerdlyAttribution, KerdlyAttributionListener, KerdlyConfigureOptions, KerdlyConsent, KerdlyDeepLink, KerdlyDeepLinkSource, KerdlyEnvironment, KerdlyEventProperties, KerdlyEventValue, KerdlyIosPurchase, KerdlyLogLevel, KerdlyNetworkSend, KerdlyPurchase, KerdlyPurchaseEvent, KerdlyRegistrationEvent, KerdlyRevenueEvent, KerdlySubscription, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpE,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
package/build/log.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { KerdlyLogLevel } from './types';
|
|
2
|
+
export declare function setLogLevel(level: KerdlyLogLevel): void;
|
|
3
|
+
export declare function isLogLevel(value: unknown): value is KerdlyLogLevel;
|
|
4
|
+
/**
|
|
5
|
+
* Development-only warning (never in release builds), muted by `logLevel: 'none' | 'error'`.
|
|
6
|
+
* This package never throws into the app, so this is how misuse is surfaced.
|
|
7
|
+
*/
|
|
8
|
+
export declare function devWarn(message: string, ...details: unknown[]): void;
|
|
9
|
+
/** Development-only error, for exceptions thrown by the app's own callbacks. */
|
|
10
|
+
export declare function devError(message: string, ...details: unknown[]): void;
|
|
11
|
+
/** `devWarn`, at most once per `key` for the lifetime of the JS runtime. */
|
|
12
|
+
export declare function devWarnOnce(key: string, message: string, ...details: unknown[]): void;
|
|
13
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAEvD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAElE;AAMD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAOpE;AAED,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAOrE;AAID,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAIrF"}
|
package/build/log.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const RANK = { none: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
2
|
+
let threshold = 'warn';
|
|
3
|
+
export function setLogLevel(level) {
|
|
4
|
+
threshold = level;
|
|
5
|
+
}
|
|
6
|
+
export function isLogLevel(value) {
|
|
7
|
+
return typeof value === 'string' && Object.prototype.hasOwnProperty.call(RANK, value);
|
|
8
|
+
}
|
|
9
|
+
function isDev() {
|
|
10
|
+
return typeof __DEV__ !== 'undefined' && __DEV__ === true;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Development-only warning (never in release builds), muted by `logLevel: 'none' | 'error'`.
|
|
14
|
+
* This package never throws into the app, so this is how misuse is surfaced.
|
|
15
|
+
*/
|
|
16
|
+
export function devWarn(message, ...details) {
|
|
17
|
+
if (!isDev() || RANK[threshold] < RANK.warn)
|
|
18
|
+
return;
|
|
19
|
+
try {
|
|
20
|
+
console.warn(`[Kerdly] ${message}`, ...details);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// console itself must never break the app
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Development-only error, for exceptions thrown by the app's own callbacks. */
|
|
27
|
+
export function devError(message, ...details) {
|
|
28
|
+
if (!isDev() || RANK[threshold] < RANK.error)
|
|
29
|
+
return;
|
|
30
|
+
try {
|
|
31
|
+
console.error(`[Kerdly] ${message}`, ...details);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// console itself must never break the app
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const warnedKeys = new Set();
|
|
38
|
+
/** `devWarn`, at most once per `key` for the lifetime of the JS runtime. */
|
|
39
|
+
export function devWarnOnce(key, message, ...details) {
|
|
40
|
+
if (warnedKeys.has(key))
|
|
41
|
+
return;
|
|
42
|
+
warnedKeys.add(key);
|
|
43
|
+
devWarn(message, ...details);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=log.js.map
|
package/build/log.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAmC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAE/F,IAAI,SAAS,GAAmB,MAAM,CAAC;AAEvC,MAAM,UAAU,WAAW,CAAC,KAAqB;IAC/C,SAAS,GAAG,KAAK,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,IAAI,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe,EAAE,GAAG,OAAkB;IAC5D,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,IAAI;QAAE,OAAO;IACpD,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,EAAE,G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