@app-swiss-knife/react-native-sdk 0.4.0 → 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 +385 -2
- 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 +365 -206
- 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 +56 -31
- package/android/vendor/java/com/appswissknife/net/IngestClient.kt +673 -87
- 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 +345 -44
- 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 +27 -6
- 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 +27 -6
- 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 +2 -0
- 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 +18 -5
- 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 +2 -0
- 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 +18 -5
- 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 +12 -4
- package/src/attribution.ts +4 -3
- package/src/identity.ts +12 -11
- package/src/index.ts +16 -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 +50 -9
- 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
|
@@ -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":"notif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AW,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;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACnE;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAA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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,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAU,CAAC;AAIlB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,C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,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAItD,2HAA2H;IAC3H,qBAAqB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,6GAA6G;IAC7G,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,oEAAoE;IACpE,0BAA0B,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7D,cAAc,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEhD,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;;;OAMG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/B;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAG7B,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,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;AAE5E;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,mBAAm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,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,6 +40,7 @@
|
|
|
38
40
|
"ios",
|
|
39
41
|
"SwissKnifePurchases.podspec",
|
|
40
42
|
"react-native.config.js",
|
|
43
|
+
"app.plugin.js",
|
|
41
44
|
"README.md",
|
|
42
45
|
"CHANGELOG.md",
|
|
43
46
|
"!**/__tests__",
|
|
@@ -47,6 +50,8 @@
|
|
|
47
50
|
"!**/*.spec.tsx",
|
|
48
51
|
"!src/react-native.d.ts",
|
|
49
52
|
"!android/src/test",
|
|
53
|
+
"!android/build",
|
|
54
|
+
"!android/.gradle",
|
|
50
55
|
"!**/*.tsbuildinfo"
|
|
51
56
|
],
|
|
52
57
|
"peerDependencies": {
|
|
@@ -104,13 +109,16 @@
|
|
|
104
109
|
"sdk",
|
|
105
110
|
"subscriptions",
|
|
106
111
|
"in-app-purchases",
|
|
107
|
-
"
|
|
112
|
+
"analytics",
|
|
113
|
+
"crash-reporting",
|
|
114
|
+
"performance-monitoring",
|
|
115
|
+
"push-notifications"
|
|
108
116
|
],
|
|
109
117
|
"scripts": {
|
|
110
118
|
"typecheck": "tsc --noEmit",
|
|
111
119
|
"test": "vitest run",
|
|
112
120
|
"check:hermes": "node scripts/hermes-boot-check.mjs",
|
|
113
|
-
"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})\"",
|
|
114
122
|
"vendor:native": "node scripts/vendor-native.mjs",
|
|
115
123
|
"build": "node scripts/vendor-native.mjs && bob build"
|
|
116
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
|
*/
|
package/src/identity.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
// packages/react-native-sdk/src/identity.ts
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// passthrough.
|
|
3
|
+
// The `Identity` JS surface. Mirror of `SwissKnife.Identity` on iOS (Swift)
|
|
4
|
+
// and `com.appswissknife.identity.Identity` on Android (Kotlin). All logic
|
|
5
|
+
// lives natively — this module is a thin passthrough.
|
|
7
6
|
//
|
|
8
7
|
// Why JS doesn't keep its own state
|
|
9
8
|
// ---------------------------------
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// the native `Identity.current()` snapshot at event-build time. See
|
|
16
|
-
// `modules/analytics.ts` for that derivation.
|
|
9
|
+
// Native is the single source of truth for who the user is. A JS-local copy
|
|
10
|
+
// would drift from it: an `Analytics.track(...)` right after
|
|
11
|
+
// `Identity.logIn("u_42")` must already carry `u_42`, so `modules/analytics.ts`
|
|
12
|
+
// derives `user_id` from the native `Identity.current()` snapshot at
|
|
13
|
+
// event-build time instead of from any JS state.
|
|
17
14
|
//
|
|
18
15
|
// Observers
|
|
19
16
|
// ---------
|
|
@@ -25,6 +22,7 @@
|
|
|
25
22
|
// rebinding). When we need that, add a `Purchases-IdentityChanged`
|
|
26
23
|
// event to the native event emitter and subscribe here.
|
|
27
24
|
|
|
25
|
+
import { notifyExplicitLogout } from "./modules/notifications";
|
|
28
26
|
import { getNativeModule } from "./native/module";
|
|
29
27
|
import type { IdentityChange, IdentitySnapshot, LogInResult } from "./types";
|
|
30
28
|
|
|
@@ -147,6 +145,7 @@ export const Identity = {
|
|
|
147
145
|
async logOut(): Promise<void> {
|
|
148
146
|
lastLogIn = null;
|
|
149
147
|
await getNativeModule().identityLogOut();
|
|
148
|
+
notifyExplicitLogout();
|
|
150
149
|
await snapshotAndNotify("logOut");
|
|
151
150
|
},
|
|
152
151
|
|
|
@@ -157,6 +156,7 @@ export const Identity = {
|
|
|
157
156
|
async reset(): Promise<void> {
|
|
158
157
|
lastLogIn = null;
|
|
159
158
|
await getNativeModule().identityReset();
|
|
159
|
+
notifyExplicitLogout();
|
|
160
160
|
await snapshotAndNotify("reset");
|
|
161
161
|
},
|
|
162
162
|
|
|
@@ -167,6 +167,7 @@ export const Identity = {
|
|
|
167
167
|
async wipe(): Promise<void> {
|
|
168
168
|
lastLogIn = null;
|
|
169
169
|
await getNativeModule().identityWipe();
|
|
170
|
+
notifyExplicitLogout();
|
|
170
171
|
await snapshotAndNotify("wipe");
|
|
171
172
|
},
|
|
172
173
|
|
package/src/index.ts
CHANGED
|
@@ -25,11 +25,11 @@ export { Attributes } from "./attributes";
|
|
|
25
25
|
|
|
26
26
|
// Public type/enum/error surface (CustomerInfo, PurchasesOfferings,
|
|
27
27
|
// PURCHASES_ERROR_CODE, LOG_LEVEL, ConfigureOptions, the enums,
|
|
28
|
-
// PurchasesError, etc.) — defined in ./types
|
|
29
|
-
// dependency).
|
|
28
|
+
// PurchasesError, etc.) — defined in ./types, this package's own definitions
|
|
29
|
+
// (no RevenueCat dependency).
|
|
30
30
|
export * from "./types";
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// Identity. Routes through native
|
|
33
33
|
// `SwissKnife.Identity` (iOS) / `com.appswissknife.identity.Identity`
|
|
34
34
|
// (Android). Decoupled from analytics: `Identity.logIn(...)` does NOT
|
|
35
35
|
// auto-emit a `$identify` event; call `Analytics.identify(...)`
|
|
@@ -37,7 +37,7 @@ export * from "./types";
|
|
|
37
37
|
export { Identity } from "./identity";
|
|
38
38
|
export type { IdentitySnapshot, IdentityChange } from "./identity";
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// Attribution. Routes through native
|
|
41
41
|
// `SwissKnife.Attribution` (iOS) / `com.appswissknife.attribution.Attribution`
|
|
42
42
|
// (Android). Native owns the ATT prompt orchestration, IDFA /
|
|
43
43
|
// AdvertisingId / InstallReferrer collection, and the disk-backed
|
|
@@ -71,3 +71,15 @@ export type {
|
|
|
71
71
|
SKSpan,
|
|
72
72
|
SKStallMeasurements,
|
|
73
73
|
} from "./modules/performance";
|
|
74
|
+
|
|
75
|
+
// Push notifications (swiss-push v1). Native mode (SDK owns the OS token) and
|
|
76
|
+
// manual mode (`expo-notifications` / RNFirebase hand us the token) share one
|
|
77
|
+
// API — see README "Push notifications".
|
|
78
|
+
export { Notifications } from "./modules/notifications";
|
|
79
|
+
export type {
|
|
80
|
+
PushProvider,
|
|
81
|
+
PushPayload,
|
|
82
|
+
PermissionStatus as PushPermissionStatus,
|
|
83
|
+
NotificationOpen as PushNotificationOpen,
|
|
84
|
+
RegisterDeviceTokenOptions as PushRegisterOptions,
|
|
85
|
+
} from "./modules/notifications";
|