@app-swiss-knife/react-native-sdk 0.3.2 → 0.5.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/CHANGELOG.md +465 -0
- package/LICENSE +21 -0
- package/README.md +229 -42
- package/SwissKnifePurchases.podspec +1 -1
- package/android/build.gradle +24 -2
- package/android/consumer-rules.pro +12 -0
- package/android/src/main/AndroidManifest.xml +15 -1
- package/android/src/main/java/com/swissknife/crashreporting/SKCrashReportingModule.kt +5 -4
- package/android/src/main/java/com/swissknife/purchases/SwissKnifeJson.kt +7 -2
- package/android/src/main/java/com/swissknife/purchases/SwissKnifePurchasesModule.kt +168 -6
- package/android/src/play/java/com/swissknife/purchases/StoreIntentHandler.kt +7 -0
- package/android/src/rustore/java/com/swissknife/purchases/StoreIntentHandler.kt +9 -0
- package/android/vendor/java/com/appswissknife/SwissKnife.kt +107 -38
- package/android/vendor/java/com/appswissknife/analytics/SKAnalytics.kt +180 -115
- package/android/vendor/java/com/appswissknife/attributes/AttributesClient.kt +16 -18
- package/android/vendor/java/com/appswissknife/attributes/SetAttributesWorker.kt +13 -13
- package/android/vendor/java/com/appswissknife/attribution/Attribution.kt +56 -25
- package/android/vendor/java/com/appswissknife/context/DeviceContext.kt +1 -1
- package/android/vendor/java/com/appswissknife/crashreporting/SKCrashReporting.kt +641 -208
- package/android/vendor/java/com/appswissknife/entitlements/EntitlementsRepository.kt +195 -26
- package/android/vendor/java/com/appswissknife/identity/Identity.kt +31 -6
- package/android/vendor/java/com/appswissknife/models/PurchasesError.kt +5 -0
- package/android/vendor/java/com/appswissknife/net/BackendHttpClient.kt +69 -35
- package/android/vendor/java/com/appswissknife/net/IngestClient.kt +756 -98
- package/android/vendor/java/com/appswissknife/net/OfflineQueueStore.kt +214 -30
- package/android/vendor/java/com/appswissknife/notifications/NotificationRenderer.kt +195 -0
- package/android/vendor/java/com/appswissknife/notifications/PermissionRequestActivity.kt +60 -0
- package/android/vendor/java/com/appswissknife/notifications/PermissionStatus.kt +41 -0
- package/android/vendor/java/com/appswissknife/notifications/PushEventQueue.kt +143 -0
- package/android/vendor/java/com/appswissknife/notifications/PushPayload.kt +72 -0
- package/android/vendor/java/com/appswissknife/notifications/PushRegistration.kt +89 -0
- package/android/vendor/java/com/appswissknife/notifications/SwissKnifeMessagingService.kt +57 -0
- package/android/vendor/java/com/appswissknife/notifications/SwissKnifeNotifications.kt +438 -0
- package/android/vendor/java/com/appswissknife/offerings/OfferingsRepository.kt +266 -64
- package/android/vendor/java/com/appswissknife/performance/SKPerformance.kt +1 -0
- package/android/vendor/java/com/appswissknife/purchases/BillingClientGateway.kt +545 -88
- package/android/vendor/java/com/appswissknife/purchases/PlayPriceEnrichmentProvider.kt +55 -24
- package/android/vendor/java/com/appswissknife/purchases/ProductKindHint.kt +21 -0
- package/android/vendor/java/com/appswissknife/purchases/PurchasesGateway.kt +14 -0
- package/android/vendor-rustore/AndroidManifest.xml +59 -0
- package/android/vendor-rustore/java/com/appswissknife/rustore/RuStoreGateway.kt +428 -0
- package/android/vendor-rustore/java/com/appswissknife/rustore/RuStoreInitProvider.kt +43 -0
- package/android/vendor-rustore/java/com/appswissknife/rustore/RuStorePriceEnrichmentProvider.kt +85 -0
- package/app.plugin.js +287 -0
- package/ios/SwissKnifePurchases.m +20 -0
- package/ios/SwissKnifePurchases.swift +97 -3
- package/ios/SwissKnifePushBootstrap.m +34 -0
- package/ios/vendor/SwissKnifeiOS/Analytics/SKAnalytics.swift +138 -89
- package/ios/vendor/SwissKnifeiOS/Context/DeviceContext.swift +1 -1
- package/ios/vendor/SwissKnifeiOS/CrashReporting/SKCrashReporting.swift +531 -100
- package/ios/vendor/SwissKnifeiOS/Net/BackendBackoffGate.swift +43 -2
- package/ios/vendor/SwissKnifeiOS/Net/IngestClient.swift +495 -16
- package/ios/vendor/SwissKnifeiOS/Net/OfflineQueueStore.swift +231 -23
- package/ios/vendor/SwissKnifeiOS/Notifications/PushPayload.swift +87 -0
- package/ios/vendor/SwissKnifeiOS/Notifications/PushRegistrar.swift +322 -0
- package/ios/vendor/SwissKnifeiOS/Notifications/SwissKnife+Notifications.swift +403 -0
- package/ios/vendor/SwissKnifeiOS/Performance/SKPerformance.swift +1 -0
- package/ios/vendor/SwissKnifeiOS/Services/EntitlementsService.swift +11 -7
- package/ios/vendor/SwissKnifeiOS/Services/PurchaseService.swift +38 -7
- package/ios/vendor/SwissKnifeiOS/SwissKnife.swift +34 -6
- package/lib/commonjs/attribution.js +4 -3
- package/lib/commonjs/attribution.js.map +1 -1
- package/lib/commonjs/identity.js +12 -11
- package/lib/commonjs/identity.js.map +1 -1
- package/lib/commonjs/index.js +16 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/config.js +105 -8
- package/lib/commonjs/internal/config.js.map +1 -1
- package/lib/commonjs/internal/telemetry-context.js +70 -0
- package/lib/commonjs/internal/telemetry-context.js.map +1 -0
- package/lib/commonjs/modules/analytics.js +18 -25
- package/lib/commonjs/modules/analytics.js.map +1 -1
- package/lib/commonjs/modules/crash-reporting.js +353 -31
- package/lib/commonjs/modules/crash-reporting.js.map +1 -1
- package/lib/commonjs/modules/log.js +1 -1
- package/lib/commonjs/modules/notifications.js +500 -0
- package/lib/commonjs/modules/notifications.js.map +1 -0
- package/lib/commonjs/modules/performance.js +57 -8
- package/lib/commonjs/modules/performance.js.map +1 -1
- package/lib/commonjs/native/module.js +6 -0
- package/lib/commonjs/native/module.js.map +1 -1
- package/lib/commonjs/native/spec.js +12 -5
- package/lib/commonjs/native/spec.js.map +1 -1
- package/lib/commonjs/purchases.js +4 -4
- package/lib/commonjs/types.js +12 -15
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/attribution.js +4 -3
- package/lib/module/attribution.js.map +1 -1
- package/lib/module/identity.js +12 -11
- package/lib/module/identity.js.map +1 -1
- package/lib/module/index.js +8 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/config.js +103 -8
- package/lib/module/internal/config.js.map +1 -1
- package/lib/module/internal/telemetry-context.js +63 -0
- package/lib/module/internal/telemetry-context.js.map +1 -0
- package/lib/module/modules/analytics.js +18 -25
- package/lib/module/modules/analytics.js.map +1 -1
- package/lib/module/modules/crash-reporting.js +353 -31
- package/lib/module/modules/crash-reporting.js.map +1 -1
- package/lib/module/modules/log.js +1 -1
- package/lib/module/modules/notifications.js +491 -0
- package/lib/module/modules/notifications.js.map +1 -0
- package/lib/module/modules/performance.js +57 -8
- package/lib/module/modules/performance.js.map +1 -1
- package/lib/module/native/module.js +6 -1
- package/lib/module/native/module.js.map +1 -1
- package/lib/module/native/spec.js +11 -4
- package/lib/module/native/spec.js.map +1 -1
- package/lib/module/purchases.js +4 -4
- package/lib/module/types.js +12 -15
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/commonjs/attribution.d.ts +3 -2
- package/lib/typescript/commonjs/attribution.d.ts.map +1 -1
- package/lib/typescript/commonjs/identity.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/config.d.ts +16 -2
- package/lib/typescript/commonjs/internal/config.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/telemetry-context.d.ts +22 -0
- package/lib/typescript/commonjs/internal/telemetry-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/analytics.d.ts +8 -11
- package/lib/typescript/commonjs/modules/analytics.d.ts.map +1 -1
- package/lib/typescript/commonjs/modules/crash-reporting.d.ts +50 -12
- package/lib/typescript/commonjs/modules/crash-reporting.d.ts.map +1 -1
- package/lib/typescript/commonjs/modules/notifications.d.ts +110 -0
- package/lib/typescript/commonjs/modules/notifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/modules/performance.d.ts +13 -0
- package/lib/typescript/commonjs/modules/performance.d.ts.map +1 -1
- package/lib/typescript/commonjs/native/module.d.ts +2 -0
- package/lib/typescript/commonjs/native/module.d.ts.map +1 -1
- package/lib/typescript/commonjs/native/spec.d.ts +33 -4
- package/lib/typescript/commonjs/native/spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/purchases.d.ts +4 -4
- package/lib/typescript/commonjs/types.d.ts +4 -5
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/module/attribution.d.ts +3 -2
- package/lib/typescript/module/attribution.d.ts.map +1 -1
- package/lib/typescript/module/identity.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/internal/config.d.ts +16 -2
- package/lib/typescript/module/internal/config.d.ts.map +1 -1
- package/lib/typescript/module/internal/telemetry-context.d.ts +22 -0
- package/lib/typescript/module/internal/telemetry-context.d.ts.map +1 -0
- package/lib/typescript/module/modules/analytics.d.ts +8 -11
- package/lib/typescript/module/modules/analytics.d.ts.map +1 -1
- package/lib/typescript/module/modules/crash-reporting.d.ts +50 -12
- package/lib/typescript/module/modules/crash-reporting.d.ts.map +1 -1
- package/lib/typescript/module/modules/notifications.d.ts +110 -0
- package/lib/typescript/module/modules/notifications.d.ts.map +1 -0
- package/lib/typescript/module/modules/performance.d.ts +13 -0
- package/lib/typescript/module/modules/performance.d.ts.map +1 -1
- package/lib/typescript/module/native/module.d.ts +2 -0
- package/lib/typescript/module/native/module.d.ts.map +1 -1
- package/lib/typescript/module/native/spec.d.ts +33 -4
- package/lib/typescript/module/native/spec.d.ts.map +1 -1
- package/lib/typescript/module/purchases.d.ts +4 -4
- package/lib/typescript/module/types.d.ts +4 -5
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/package.json +13 -4
- package/src/attribution.ts +4 -3
- package/src/identity.ts +12 -11
- package/src/index.ts +18 -4
- package/src/internal/config.ts +113 -8
- package/src/internal/telemetry-context.ts +76 -0
- package/src/modules/analytics.ts +24 -33
- package/src/modules/crash-reporting.ts +476 -67
- package/src/modules/log.ts +1 -1
- package/src/modules/notifications.ts +557 -0
- package/src/modules/performance.ts +94 -14
- package/src/native/module.ts +6 -0
- package/src/native/spec.ts +45 -10
- package/src/purchases.ts +4 -4
- package/src/types.ts +12 -15
- package/android/vendor/java/com/appswissknife/analytics/EventQueueStore.kt +0 -326
- package/android/vendor/java/com/appswissknife/analytics/FlushEventsWorker.kt +0 -296
|
@@ -2,14 +2,18 @@ import React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Optional native module for crash reporting. If the host app has linked
|
|
4
4
|
* the SwissKnife iOS/Android native crash SDKs, this module delegates
|
|
5
|
-
* init/setUser/addBreadcrumb to the native layer — catching
|
|
6
|
-
*
|
|
5
|
+
* init/setUser/addBreadcrumb to the native layer — catching signal crashes and
|
|
6
|
+
* uncaught NSExceptions (iOS) and NDK native crashes (Android) that JS can't
|
|
7
|
+
* see. iOS installs no Mach exception handler.
|
|
7
8
|
*/
|
|
8
9
|
interface SKCrashReportingNative {
|
|
10
|
+
/**
|
|
11
|
+
* Both bridges read these keys. Telemetry goes to `serverURL`
|
|
12
|
+
* (`<serverURL>/ingest`); there is no separate ingest host.
|
|
13
|
+
*/
|
|
9
14
|
start(config: {
|
|
10
15
|
apiKey: string;
|
|
11
16
|
serverURL: string;
|
|
12
|
-
ingestURL?: string;
|
|
13
17
|
environment: string;
|
|
14
18
|
release: string;
|
|
15
19
|
}): void;
|
|
@@ -79,8 +83,15 @@ export interface CrashReportingConfig {
|
|
|
79
83
|
*/
|
|
80
84
|
enableAppStateTracking?: boolean;
|
|
81
85
|
/**
|
|
82
|
-
* Start the NATIVE crash handler
|
|
83
|
-
*
|
|
86
|
+
* Start the NATIVE crash handler via the native module. Default **true**.
|
|
87
|
+
*
|
|
88
|
+
* iOS: `signal()` handlers for SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV and
|
|
89
|
+
* SIGTRAP, the uncaught-NSException handler, and a main-thread hang (ANR)
|
|
90
|
+
* watchdog. There is no Mach exception handler and no alternate signal
|
|
91
|
+
* stack, so a crash that never reaches one of those handlers (a stack
|
|
92
|
+
* overflow, for example) is not reported. Android: uncaught JVM exceptions,
|
|
93
|
+
* an ANR watchdog, and, on Android 11+, NDK native crashes and system ANRs
|
|
94
|
+
* from the previous launch.
|
|
84
95
|
*
|
|
85
96
|
* Our native handlers chain (they capture and re-invoke the previous
|
|
86
97
|
* `NSSetUncaughtExceptionHandler` / `signal()` / Java
|
|
@@ -137,6 +148,8 @@ export interface SKParsedFrame {
|
|
|
137
148
|
inApp: boolean;
|
|
138
149
|
}
|
|
139
150
|
export interface SKCrashEvent {
|
|
151
|
+
sessionId?: string;
|
|
152
|
+
traceId?: string;
|
|
140
153
|
eventId: string;
|
|
141
154
|
timestamp: number;
|
|
142
155
|
level: "debug" | "info" | "warning" | "error" | "fatal";
|
|
@@ -153,15 +166,35 @@ export interface SKCrashEvent {
|
|
|
153
166
|
dist?: string;
|
|
154
167
|
platform: string;
|
|
155
168
|
mechanism?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Custom grouping key (Sentry-compatible). Events with the same
|
|
171
|
+
* fingerprint are one issue. Entries may be templates the server expands:
|
|
172
|
+
* `{{ default }}` (the normal grouping), `{{ type }}`, `{{ value }}`,
|
|
173
|
+
* `{{ message }}`, `{{ tags.<key> }}` — e.g.
|
|
174
|
+
* `["{{ default }}", "{{ tags.region }}"]` splits the default issue by
|
|
175
|
+
* region.
|
|
176
|
+
*/
|
|
177
|
+
fingerprint?: string[];
|
|
156
178
|
/** `false` for events captured by the SDK's global hooks (fatal errors,
|
|
157
179
|
* unhandled promise rejections); unset for manual captures. */
|
|
158
180
|
handled?: boolean;
|
|
159
181
|
contexts?: Record<string, unknown>;
|
|
160
182
|
}
|
|
161
|
-
interface SKCrashScope {
|
|
183
|
+
export interface SKCrashScope {
|
|
162
184
|
setTag: (key: string, value: string) => void;
|
|
163
185
|
setExtra: (key: string, value: unknown) => void;
|
|
164
186
|
setUser: (user: SKCrashUser | null) => void;
|
|
187
|
+
/**
|
|
188
|
+
* Fingerprint for every event captured after this call (until cleared
|
|
189
|
+
* with `null` / `[]`). A per-call `captureException(err, { fingerprint })`
|
|
190
|
+
* wins over it. See `SKCrashEvent.fingerprint` for templates.
|
|
191
|
+
*/
|
|
192
|
+
setFingerprint: (fingerprint: string[] | null) => void;
|
|
193
|
+
}
|
|
194
|
+
export interface SKCaptureExceptionOptions {
|
|
195
|
+
tags?: Record<string, string>;
|
|
196
|
+
/** Custom grouping key for this event; overrides the scope's. */
|
|
197
|
+
fingerprint?: string[];
|
|
165
198
|
}
|
|
166
199
|
/**
|
|
167
200
|
* Parse a JS Error stack string into structured frames.
|
|
@@ -170,6 +203,11 @@ interface SKCrashScope {
|
|
|
170
203
|
* at filename.js:line:col
|
|
171
204
|
*/
|
|
172
205
|
export declare function parseStackTrace(stack: string): SKParsedFrame[];
|
|
206
|
+
/** The fields of the native `Identity.current()` snapshot this module reads. */
|
|
207
|
+
interface IdentitySnapshot {
|
|
208
|
+
userId?: string | null;
|
|
209
|
+
anonymousId?: string | null;
|
|
210
|
+
}
|
|
173
211
|
interface RNPlatformConstants {
|
|
174
212
|
systemName?: string;
|
|
175
213
|
osVersion?: string;
|
|
@@ -194,9 +232,7 @@ export interface PlatformLike {
|
|
|
194
232
|
export declare function buildStaticContexts(platform: PlatformLike): Record<string, unknown>;
|
|
195
233
|
export declare const CrashReporting: {
|
|
196
234
|
init(config: CrashReportingConfig): void;
|
|
197
|
-
captureException(error: Error, options?: {
|
|
198
|
-
tags?: Record<string, string>;
|
|
199
|
-
}): {
|
|
235
|
+
captureException(error: Error, options?: SKCaptureExceptionOptions): {
|
|
200
236
|
eventId: string;
|
|
201
237
|
};
|
|
202
238
|
captureEvent(partial: Partial<SKCrashEvent>): {
|
|
@@ -256,6 +292,10 @@ export declare const CrashReporting: {
|
|
|
256
292
|
backoffUntil: number;
|
|
257
293
|
};
|
|
258
294
|
_snapshotSessionId(): string | null;
|
|
295
|
+
_snapshotPendingSessions(): Array<{
|
|
296
|
+
sessionId: string;
|
|
297
|
+
status: string;
|
|
298
|
+
}>;
|
|
259
299
|
_restorePromiseForTests(): Promise<void> | null;
|
|
260
300
|
/** Test seam: override native screenshot capture (offline-store pattern).
|
|
261
301
|
* `null` = native absent; `undefined` = resolve from NativeModules. */
|
|
@@ -272,9 +312,7 @@ export declare const CrashReporting: {
|
|
|
272
312
|
/** Test seam: stand in for the native `Identity.current()` bridge call.
|
|
273
313
|
* `null` = Identity bridge absent; `undefined` = resolve from react-native.
|
|
274
314
|
* Clears the cached subject so the next resolve goes through the seam. */
|
|
275
|
-
_setIdentityResolverForTests(resolver: (() => Promise<
|
|
276
|
-
userId?: string | null;
|
|
277
|
-
}>) | null | undefined): void;
|
|
315
|
+
_setIdentityResolverForTests(resolver: (() => Promise<IdentitySnapshot>) | null | undefined): void;
|
|
278
316
|
/** @internal Current Identity-derived subject id, for assertions. */
|
|
279
317
|
_identitySubjectForTests(): string | null;
|
|
280
318
|
/** Test seam: stand in for react-native's `AppState`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crash-reporting.d.ts","sourceRoot":"","sources":["../../../../src/modules/crash-reporting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crash-reporting.d.ts","sourceRoot":"","sources":["../../../../src/modules/crash-reporting.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;;;;;GAMG;AACH,UAAU,sBAAsB;IAC9B;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,OAAO,CACL,IAAI,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAC9D,IAAI,CAAC;IACR,aAAa,CAAC,UAAU,EAAE;QACx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CAAC;CACzD;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,qBAAa,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAClD,oBAAoB,EACpB,oBAAoB,CACrB;gBACa,KAAK,EAAE,oBAAoB;IAKvC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,oBAAoB;IAInE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAa5D,MAAM,IAAI,KAAK,CAAC,SAAS;CAM1B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export type PushProvider = "apns" | "fcm";
|
|
2
|
+
export type PermissionStatus = "authorized" | "provisional" | "denied" | "not_determined" | "ephemeral";
|
|
3
|
+
/** Swiss Knife metadata extracted from a notification's data. */
|
|
4
|
+
export interface PushPayload {
|
|
5
|
+
messageId: string;
|
|
6
|
+
deliveryId: string;
|
|
7
|
+
link?: string;
|
|
8
|
+
imageUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
/** A tapped notification (or action button), as delivered by native mode. */
|
|
11
|
+
export interface NotificationOpen {
|
|
12
|
+
messageId?: string;
|
|
13
|
+
deliveryId?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
actionId?: string;
|
|
16
|
+
data: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface RegisterDeviceTokenOptions {
|
|
19
|
+
/** iOS only. Defaults to native detection (provisioning profile), else "production". */
|
|
20
|
+
environment?: "production" | "sandbox";
|
|
21
|
+
/** Defaults to the native permission status, else "authorized". Accepts expo-notifications' values too. */
|
|
22
|
+
permissionStatus?: string;
|
|
23
|
+
/** Override when the native module cannot supply it. */
|
|
24
|
+
bundleId?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface TrackOptions {
|
|
27
|
+
/** Set when a custom action button was pressed; the event becomes `action`. */
|
|
28
|
+
actionId?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Pull the Swiss Knife payload out of whatever a push library hands you.
|
|
32
|
+
* Accepts the bare `data` object (iOS `sk` or Android `sk_*` shapes), and the
|
|
33
|
+
* common wrappers: expo-notifications' `response` / `notification` and
|
|
34
|
+
* RNFirebase's `remoteMessage`. Returns null for foreign notifications.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractPayload(input: unknown): PushPayload | null;
|
|
37
|
+
/**
|
|
38
|
+
* Normalize a permission status from any source (our native modules, or
|
|
39
|
+
* expo-notifications' `granted`/`denied`/`undetermined`) to the wire enum.
|
|
40
|
+
*/
|
|
41
|
+
export declare function normalizePermissionStatus(raw: unknown): PermissionStatus;
|
|
42
|
+
/** Send queued `received`/`opened` events now. Failed batches stay queued. */
|
|
43
|
+
export declare function flushEvents(): Promise<void>;
|
|
44
|
+
export declare const Notifications: {
|
|
45
|
+
/**
|
|
46
|
+
* Ask the user for notification permission (native mode). On iOS,
|
|
47
|
+
* `provisional` delivers quietly with no prompt; Android ignores it
|
|
48
|
+
* (API 33+ shows the POST_NOTIFICATIONS dialog).
|
|
49
|
+
*/
|
|
50
|
+
requestPermission(options?: {
|
|
51
|
+
provisional?: boolean;
|
|
52
|
+
}): Promise<PermissionStatus>;
|
|
53
|
+
getPermissionStatus(): Promise<PermissionStatus>;
|
|
54
|
+
/**
|
|
55
|
+
* Native mode. iOS: `registerForRemoteNotifications` (token captured
|
|
56
|
+
* natively). Android: fetches the FCM token through the native SDK. The
|
|
57
|
+
* device is upserted automatically once a token arrives.
|
|
58
|
+
*/
|
|
59
|
+
registerForPushNotifications(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Manual mode: register a token you obtained elsewhere
|
|
62
|
+
* (`expo-notifications`' `getDevicePushTokenAsync()`, RNFirebase's
|
|
63
|
+
* `messaging().getToken()`). Idempotent — an identical registration in this
|
|
64
|
+
* session is not re-sent; call again after login/logout to relink the user.
|
|
65
|
+
*
|
|
66
|
+
* @returns the server's device id, or null when nothing needed sending.
|
|
67
|
+
*/
|
|
68
|
+
registerDeviceToken(token: string, provider: PushProvider, options?: RegisterDeviceTokenOptions): Promise<string | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Stop pushes to this install: marks the device unregistered on the server
|
|
71
|
+
* (token = null) and, in native mode, drops the OS registration. Call on
|
|
72
|
+
* sign-out if the next user should not receive this user's notifications —
|
|
73
|
+
* or simply call `Identity.logOut()`, which relinks the device.
|
|
74
|
+
*/
|
|
75
|
+
unregister(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Record that the user opened a notification. Pass the notification `data`
|
|
78
|
+
* (or the whole expo-notifications response / RNFirebase message); foreign
|
|
79
|
+
* notifications are ignored. Returns true when an event was queued.
|
|
80
|
+
* Not needed in native mode, where opens are tracked automatically.
|
|
81
|
+
*/
|
|
82
|
+
trackOpened(input: unknown, options?: TrackOptions): boolean;
|
|
83
|
+
/** Record that a notification was delivered (foreground handler / background task). */
|
|
84
|
+
trackReceived(input: unknown): boolean;
|
|
85
|
+
extractPayload: typeof extractPayload;
|
|
86
|
+
flushEvents: typeof flushEvents;
|
|
87
|
+
/**
|
|
88
|
+
* Native mode: subscribe to tapped notifications (and action buttons).
|
|
89
|
+
* Returns a subscription; call `.remove()` to unsubscribe.
|
|
90
|
+
*/
|
|
91
|
+
addNotificationOpenedListener(callback: (open: NotificationOpen) => void): {
|
|
92
|
+
remove(): void;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Native mode: the notification that cold-started the app, once.
|
|
96
|
+
* On iOS this needs native auto-integration to be enabled before the
|
|
97
|
+
* launch finishes (see README, "Push notifications").
|
|
98
|
+
*/
|
|
99
|
+
getInitialNotification(): Promise<NotificationOpen | null>;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* @internal Called by `Identity.logOut/reset/wipe`: the one transition that
|
|
103
|
+
* unlinks the user. Re-upserts the manually registered device with
|
|
104
|
+
* `user_id: null`; a failure leaves the flag set so the next registration
|
|
105
|
+
* retries it.
|
|
106
|
+
*/
|
|
107
|
+
export declare function notifyExplicitLogout(): void;
|
|
108
|
+
/** @internal Test seam. */
|
|
109
|
+
export declare function __resetNotificationsForTests(): void;
|
|
110
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/modules/notifications.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,aAAa,GACb,QAAQ,GACR,gBAAgB,GAChB,WAAW,CAAC;AAEhB,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,wFAAwF;IACxF,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAoDD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAsBjE;AAID;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAexE;AAuLD,8EAA8E;AAC9E,wBAAgB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA4B3C;AA2BD,eAAO,MAAM,aAAa;IACxB;;;;OAIG;gCAC8B;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAQ,OAAO,CAAC,gBAAgB,CAAC;2BAK9D,OAAO,CAAC,gBAAgB,CAAC;IAItD;;;;OAIG;oCACmC,OAAO,CAAC,IAAI,CAAC;IAInD;;;;;;;OAOG;+BAEM,MAAM,YACH,YAAY,YACb,0BAA0B,GAClC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAezB;;;;;OAKG;kBACiB,OAAO,CAAC,IAAI,CAAC;IAkBjC;;;;;OAKG;uBACgB,OAAO,YAAW,YAAY,GAAQ,OAAO;IAOhE,uFAAuF;yBAClE,OAAO,GAAG,OAAO;;;IAUtC;;;OAGG;4CACqC,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG;QAAE,MAAM,IAAI,IAAI,CAAA;KAAE;IAQ7F;;;;OAIG;8BAC6B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAIjE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAED,2BAA2B;AAC3B,wBAAgB,4BAA4B,IAAI,IAAI,CAUnD"}
|
|
@@ -3,6 +3,7 @@ export interface PerformanceConfig {
|
|
|
3
3
|
serverURL?: string;
|
|
4
4
|
environment?: string;
|
|
5
5
|
release?: string;
|
|
6
|
+
buildNumber?: string;
|
|
6
7
|
enableAutoHTTP?: boolean;
|
|
7
8
|
/** Transaction sample rate (0.0 to 1.0, default 1.0). */
|
|
8
9
|
tracesSampleRate?: number;
|
|
@@ -16,6 +17,12 @@ export interface PerformanceConfig {
|
|
|
16
17
|
name: string;
|
|
17
18
|
op?: string;
|
|
18
19
|
}) => number;
|
|
20
|
+
/**
|
|
21
|
+
* Record the cold start as an `app.start` transaction, from the moment this
|
|
22
|
+
* module loaded to your call of `Performance.finishAppStart()` (call it when
|
|
23
|
+
* the first screen is interactive). Off by default; sampling applies.
|
|
24
|
+
*/
|
|
25
|
+
trackAppStart?: boolean;
|
|
19
26
|
}
|
|
20
27
|
/** Stall aggregation attached to the transaction payload as `measurements`. */
|
|
21
28
|
export interface SKStallMeasurements {
|
|
@@ -56,6 +63,12 @@ export interface SKSpan {
|
|
|
56
63
|
declare function createNavigationTracker(): (state: unknown) => void;
|
|
57
64
|
export declare const Performance: {
|
|
58
65
|
init(config: PerformanceConfig): void;
|
|
66
|
+
/**
|
|
67
|
+
* Ends the `app.start` transaction begun by `trackAppStart: true`. Call it
|
|
68
|
+
* when the first screen is interactive. Once per launch; a no-op when
|
|
69
|
+
* app-start tracking is off, sampled out, or already finished.
|
|
70
|
+
*/
|
|
71
|
+
finishAppStart(status?: string): void;
|
|
59
72
|
startTransaction(name: string, op: string): SKTransaction;
|
|
60
73
|
/**
|
|
61
74
|
* Returns the current trace propagation headers for the active transaction.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/modules/performance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/modules/performance.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OA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C;AAyaD;;;;;;;;;GASG;AACH,iBAAS,uBAAuB,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAyC3D;AAqBD,eAAO,MAAM,WAAW;iBACT,iBAAiB,GAAG,IAAI;IAerC;;;;OAIG;qCAC4B,IAAI;2BAQZ,MAAM,MAAM,MAAM,GAAG,aAAa;IASzD;;;OAGG;oBACa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IAYtC,sEAAsE;aACvD,OAAO,CAAC,IAAI,CAAC;cAUlB,IAAI;IAqBd,wEAAwE;oCACxC,MAAM,GAAG,IAAI;kCAIf,OAAO;qCAIJ,MAAM;CAGxC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NativeEventEmitter } from "react-native";
|
|
2
2
|
import type { SwissKnifePurchasesNativeModule } from "./spec.js";
|
|
3
3
|
export declare function getNativeModule(): SwissKnifePurchasesNativeModule;
|
|
4
|
+
/** "ios" or "android" (anything else is treated as android, the only other native target). */
|
|
5
|
+
export declare function getPlatformOS(): "ios" | "android";
|
|
4
6
|
export declare function getEventEmitter(): NativeEventEmitter;
|
|
5
7
|
export declare function __resetNativeModuleForTests(): void;
|
|
6
8
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/native/module.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/native/module.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAGnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,WAAQ,CAAC;AAsB9D,wBAAgB,eAAe,IAAI,+BAA+B,CAMjE;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,IAAI,KAAK,GAAG,SAAS,CAEjD;AAED,wBAAgB,eAAe,IAAI,kBAAkB,CAIpD;AAGD,wBAAgB,2BAA2B,IAAI,IAAI,CAGlD"}
|
|
@@ -12,6 +12,26 @@ export interface NativeConfigureOptions {
|
|
|
12
12
|
logLevel?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const CUSTOMER_INFO_UPDATED_EVENT = "Purchases-CustomerInfoUpdated";
|
|
15
|
+
/** Emitted by native when a Swiss Knife push notification (or one of its action buttons) is tapped. */
|
|
16
|
+
export declare const PUSH_OPENED_EVENT = "SwissKnife-PushOpened";
|
|
17
|
+
/** Wire shape of a tapped notification, both platforms. */
|
|
18
|
+
export interface NativePushOpen {
|
|
19
|
+
messageId?: string;
|
|
20
|
+
deliveryId?: string;
|
|
21
|
+
link?: string;
|
|
22
|
+
actionId?: string;
|
|
23
|
+
/** Raw notification data (iOS: full userInfo; Android: the string data map). */
|
|
24
|
+
data?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/** Facts only native knows, for the JS-only token registration path. */
|
|
27
|
+
export interface NativePushDeviceInfo {
|
|
28
|
+
bundleId: string;
|
|
29
|
+
appVersion?: string;
|
|
30
|
+
osVersion?: string;
|
|
31
|
+
sdkVersion?: string;
|
|
32
|
+
/** iOS only: "production" | "sandbox" derived from the provisioning profile. */
|
|
33
|
+
environment?: string;
|
|
34
|
+
}
|
|
15
35
|
export interface SwissKnifePurchasesNativeModule extends TurboModule {
|
|
16
36
|
configure(options: NativeConfigureOptions): Promise<void>;
|
|
17
37
|
/**
|
|
@@ -55,9 +75,9 @@ export interface SwissKnifePurchasesNativeModule extends TurboModule {
|
|
|
55
75
|
identityCurrent(): Promise<IdentitySnapshot>;
|
|
56
76
|
/**
|
|
57
77
|
* Identify this device as a known user. Native posts the
|
|
58
|
-
* (anonymous_id, user_id) pair to /api/sdk/users/identify
|
|
59
|
-
*
|
|
60
|
-
*
|
|
78
|
+
* (anonymous_id, user_id) pair to /api/sdk/users/identify on both
|
|
79
|
+
* platforms and rebinds entitlements + analytics user_id from the same
|
|
80
|
+
* callsite.
|
|
61
81
|
*/
|
|
62
82
|
identityLogIn(userId: string): Promise<LogInResult>;
|
|
63
83
|
/** Revert to anonymous. DeviceID stays stable across logout. */
|
|
@@ -100,6 +120,15 @@ export interface SwissKnifePurchasesNativeModule extends TurboModule {
|
|
|
100
120
|
setDisplayName(displayName: string | null): Promise<void>;
|
|
101
121
|
setPhoneNumber(phoneNumber: string | null): Promise<void>;
|
|
102
122
|
setPushToken(pushToken: string | null): Promise<void>;
|
|
123
|
+
/** Prompt for notification permission. `provisional` is iOS-only (ignored on Android). Resolves the wire status string. */
|
|
124
|
+
pushRequestPermission(provisional: boolean): Promise<string>;
|
|
125
|
+
pushPermissionStatus(): Promise<string>;
|
|
126
|
+
/** iOS: registerForRemoteNotifications + delegate proxy. Android: fetch the FCM token via the native SDK. */
|
|
127
|
+
pushRegister(): Promise<void>;
|
|
128
|
+
pushUnregister(): Promise<void>;
|
|
129
|
+
/** The notification that launched the app, once; null when none. */
|
|
130
|
+
pushGetInitialNotification(): Promise<NativePushOpen | null>;
|
|
131
|
+
pushDeviceInfo(): Promise<NativePushDeviceInfo>;
|
|
103
132
|
setLogLevel(level: string): Promise<void>;
|
|
104
133
|
/**
|
|
105
134
|
* Persistent per-device identifier, sourced from the native SDK (iOS Keychain
|
|
@@ -127,7 +156,7 @@ export interface SwissKnifePurchasesNativeModule extends TurboModule {
|
|
|
127
156
|
/**
|
|
128
157
|
* Persist a pre-built analytics event onto the native disk-backed queue.
|
|
129
158
|
*
|
|
130
|
-
*
|
|
159
|
+
* JS owns the payload shape (event_id,
|
|
131
160
|
* device_id, super properties, timed-event duration, identify merges) and
|
|
132
161
|
* native owns the queue (disk persistence on iOS Caches / Android cacheDir,
|
|
133
162
|
* exponential back-off, dead-letter on permanent failure). Once this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/native/spec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cA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E,MAAM,GAAG,IAAI,CAAC;CACtC;AAID,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -74,7 +74,7 @@ export declare class Purchases {
|
|
|
74
74
|
* Works after `SwissKnife.configure`, `SwissKnife.configureCore`, or
|
|
75
75
|
* `Analytics.init` — the store does not have to be ours.
|
|
76
76
|
*
|
|
77
|
-
* @deprecated
|
|
77
|
+
* @deprecated Prefer `Identity.logIn(userId)`. This alias exists so
|
|
78
78
|
* RevenueCat migrations compile unchanged; it is a pure delegation, so there
|
|
79
79
|
* is nothing to gain by keeping it and one less name to learn by dropping it.
|
|
80
80
|
*/
|
|
@@ -91,7 +91,7 @@ export declare class Purchases {
|
|
|
91
91
|
* the same record, built in JS, on both platforms. Do not read that as a
|
|
92
92
|
* store error; if you want real entitlements, call `getCustomerInfo()`.
|
|
93
93
|
*
|
|
94
|
-
* @deprecated
|
|
94
|
+
* @deprecated Prefer `Identity.logOut()`, which does not pretend to
|
|
95
95
|
* return store state.
|
|
96
96
|
*/
|
|
97
97
|
static logOut(): Promise<CustomerInfo>;
|
|
@@ -104,7 +104,7 @@ export declare class Purchases {
|
|
|
104
104
|
* gateway's own anonymous id is a different, per-process value, and this
|
|
105
105
|
* alias deliberately does not report it.
|
|
106
106
|
*
|
|
107
|
-
* @deprecated
|
|
107
|
+
* @deprecated Prefer `Identity.current()`, which hands back the
|
|
108
108
|
* anonymous id, the user id and `isAnonymous` in one read instead of forcing
|
|
109
109
|
* two calls that can interleave.
|
|
110
110
|
*/
|
|
@@ -115,7 +115,7 @@ export declare class Purchases {
|
|
|
115
115
|
* Exactly `(await Identity.current()).isAnonymous`, so it tracks
|
|
116
116
|
* `Identity.reset()` and `Identity.wipe()` on both platforms.
|
|
117
117
|
*
|
|
118
|
-
* @deprecated
|
|
118
|
+
* @deprecated Prefer `Identity.current()`; see
|
|
119
119
|
* {@link getAppUserID}.
|
|
120
120
|
*/
|
|
121
121
|
static isAnonymous(): Promise<boolean>;
|
|
@@ -24,9 +24,9 @@ export declare const PACKAGE_TYPE: {
|
|
|
24
24
|
};
|
|
25
25
|
export type PACKAGE_TYPE = (typeof PACKAGE_TYPE)[keyof typeof PACKAGE_TYPE];
|
|
26
26
|
/**
|
|
27
|
-
* StoreKit version selection on iOS.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* StoreKit version selection on iOS. The SDK always uses StoreKit 2; the enum
|
|
28
|
+
* stays for source compatibility, and `configure({ storeKitVersion: ... })` is
|
|
29
|
+
* a no-op.
|
|
30
30
|
*/
|
|
31
31
|
export declare const STOREKIT_VERSION: {
|
|
32
32
|
readonly DEFAULT: "DEFAULT";
|
|
@@ -312,8 +312,7 @@ export interface LogInResult {
|
|
|
312
312
|
* `SwissKnife.Identity.Snapshot` (iOS) and
|
|
313
313
|
* `com.appswissknife.identity.Identity.Snapshot` (Android).
|
|
314
314
|
*
|
|
315
|
-
* The `anonymousId` carries the
|
|
316
|
-
* Wave 1 (was `$RCAnonymousID:` on Android pre-Wave-1).
|
|
315
|
+
* The `anonymousId` carries the `$SKAnonymousID:` prefix on both platforms.
|
|
317
316
|
*/
|
|
318
317
|
export interface IdentitySnapshot {
|
|
319
318
|
anonymousId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,sEAAsE;AACtE,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE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AAM,GAAG,IAAI,CAAC;IAC1B,oHAAoH;IACpH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oCAAoC,CAAC,EAAE,OAAO,CAAC;IAC/C,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,yCAAyC,CAAC,EAAE,OAAO,CAAC;CACrD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAIF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-swiss-knife/react-native-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "React Native SDK for App Swiss Knife: subscriptions and in-app purchases, analytics, crash reporting, performance monitoring and push notifications. The Purchases API keeps react-native-purchases names for the methods it implements.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"./package.json": "./package.json",
|
|
22
|
+
"./app.plugin": "./app.plugin.js",
|
|
23
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
22
24
|
"./*": {
|
|
23
25
|
"react-native": "./lib/module/*.js",
|
|
24
26
|
"import": {
|
|
@@ -38,7 +40,9 @@
|
|
|
38
40
|
"ios",
|
|
39
41
|
"SwissKnifePurchases.podspec",
|
|
40
42
|
"react-native.config.js",
|
|
43
|
+
"app.plugin.js",
|
|
41
44
|
"README.md",
|
|
45
|
+
"CHANGELOG.md",
|
|
42
46
|
"!**/__tests__",
|
|
43
47
|
"!**/*.test.ts",
|
|
44
48
|
"!**/*.test.tsx",
|
|
@@ -46,6 +50,8 @@
|
|
|
46
50
|
"!**/*.spec.tsx",
|
|
47
51
|
"!src/react-native.d.ts",
|
|
48
52
|
"!android/src/test",
|
|
53
|
+
"!android/build",
|
|
54
|
+
"!android/.gradle",
|
|
49
55
|
"!**/*.tsbuildinfo"
|
|
50
56
|
],
|
|
51
57
|
"peerDependencies": {
|
|
@@ -103,13 +109,16 @@
|
|
|
103
109
|
"sdk",
|
|
104
110
|
"subscriptions",
|
|
105
111
|
"in-app-purchases",
|
|
106
|
-
"
|
|
112
|
+
"analytics",
|
|
113
|
+
"crash-reporting",
|
|
114
|
+
"performance-monitoring",
|
|
115
|
+
"push-notifications"
|
|
107
116
|
],
|
|
108
117
|
"scripts": {
|
|
109
118
|
"typecheck": "tsc --noEmit",
|
|
110
119
|
"test": "vitest run",
|
|
111
120
|
"check:hermes": "node scripts/hermes-boot-check.mjs",
|
|
112
|
-
"clean": "node -e \"for (const d of ['lib','ios/vendor','android/vendor']) require('fs').rmSync(d,{recursive:true,force:true})\"",
|
|
121
|
+
"clean": "node -e \"for (const d of ['lib','ios/vendor','android/vendor','android/vendor-rustore']) require('fs').rmSync(d,{recursive:true,force:true})\"",
|
|
113
122
|
"vendor:native": "node scripts/vendor-native.mjs",
|
|
114
123
|
"build": "node scripts/vendor-native.mjs && bob build"
|
|
115
124
|
}
|
package/src/attribution.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/react-native-sdk/src/attribution.ts
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// The Attribution JS surface. Mirror of
|
|
4
4
|
// `SwissKnife.Attribution` (iOS, Swift) and
|
|
5
5
|
// `com.appswissknife.attribution.Attribution` (Android, Kotlin). All
|
|
6
6
|
// logic lives natively — this module is a thin passthrough.
|
|
@@ -32,8 +32,9 @@ export const Attribution = {
|
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* Collect what the platform allows (ATT prompt + IDFA on iOS; on Android
|
|
36
|
+
* only what native collectors supply, none by default) and POST
|
|
37
|
+
* `/api/sdk/attribution/install`.
|
|
37
38
|
* Idempotent — second call returns the cached resolution WITHOUT
|
|
38
39
|
* re-prompting or re-POSTing.
|
|
39
40
|
*/
|