@altcraft/react-native-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +46 -0
- package/Sdk.podspec +48 -0
- package/android/build.gradle +78 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/altcraft/sdk/SdkModule.kt +1242 -0
- package/android/src/main/java/com/altcraft/sdk/SdkPackage.kt +33 -0
- package/android/src/main/java/com/altcraft/sdk/interfaces/RnFCMProvider.kt +27 -0
- package/android/src/main/java/com/altcraft/sdk/interfaces/RnHMSProvider.kt +32 -0
- package/android/src/main/java/com/altcraft/sdk/interfaces/RnJWTProvider.kt +21 -0
- package/android/src/main/java/com/altcraft/sdk/interfaces/RnRustoreProvider.kt +53 -0
- package/ios/Sdk.h +19 -0
- package/ios/Sdk.mm +1112 -0
- package/ios/SdkModule.swift +888 -0
- package/ios/protocols/RNAPNSProvider.swift +15 -0
- package/ios/protocols/RNFCMProvider.swift +24 -0
- package/ios/protocols/RNHMSProvider.swift +24 -0
- package/ios/protocols/RNJWTProvider.swift +15 -0
- package/lib/module/NativeSdk.js +13 -0
- package/lib/module/NativeSdk.js.map +1 -0
- package/lib/module/index.js +561 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeSdk.d.ts +114 -0
- package/lib/typescript/src/NativeSdk.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +391 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +128 -0
- package/react-native.config.js +10 -0
- package/src/NativeSdk.ts +171 -0
- package/src/index.tsx +670 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type TurboModule } from 'react-native';
|
|
2
|
+
export type CategoryData = {
|
|
3
|
+
name?: string | null;
|
|
4
|
+
title?: string | null;
|
|
5
|
+
steady?: boolean | null;
|
|
6
|
+
active?: boolean | null;
|
|
7
|
+
};
|
|
8
|
+
export type SubscriptionData = {
|
|
9
|
+
subscriptionId?: string | null;
|
|
10
|
+
hashId?: string | null;
|
|
11
|
+
provider?: string | null;
|
|
12
|
+
status?: string | null;
|
|
13
|
+
fields?: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
} | null;
|
|
16
|
+
cats?: CategoryData[] | null;
|
|
17
|
+
};
|
|
18
|
+
export interface ProfileData {
|
|
19
|
+
id?: string | null;
|
|
20
|
+
status?: string | null;
|
|
21
|
+
isTest?: boolean | null;
|
|
22
|
+
subscription?: SubscriptionData | null;
|
|
23
|
+
}
|
|
24
|
+
export interface Response {
|
|
25
|
+
error?: number | null;
|
|
26
|
+
errorText?: string | null;
|
|
27
|
+
profile?: ProfileData | null;
|
|
28
|
+
}
|
|
29
|
+
export interface ResponseWithHttpCode {
|
|
30
|
+
httpCode: number | null;
|
|
31
|
+
response: Response | null;
|
|
32
|
+
}
|
|
33
|
+
export interface AppInfo {
|
|
34
|
+
appID: string;
|
|
35
|
+
appIID: string;
|
|
36
|
+
appVer: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AltcraftConfig {
|
|
39
|
+
apiUrl: string;
|
|
40
|
+
rToken?: string | null;
|
|
41
|
+
appInfo?: AppInfo | null;
|
|
42
|
+
providerPriorityList?: string[] | null;
|
|
43
|
+
enableLogging?: boolean | null;
|
|
44
|
+
android_icon?: number | null;
|
|
45
|
+
android_usingService?: boolean | null;
|
|
46
|
+
android_serviceMessage?: string | null;
|
|
47
|
+
android_pushReceiverModules?: string[] | null;
|
|
48
|
+
android_pushChannelName?: string | null;
|
|
49
|
+
android_pushChannelDescription?: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface TokenData {
|
|
52
|
+
provider: string | null;
|
|
53
|
+
token: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface Spec extends TurboModule {
|
|
56
|
+
initialize(config: AltcraftConfig): Promise<void>;
|
|
57
|
+
setJwt(token: string | null): void;
|
|
58
|
+
setAndroidFcmToken(token: string | null): void;
|
|
59
|
+
setAndroidHmsToken(token: string | null): void;
|
|
60
|
+
setIosFcmToken(token: string | null): void;
|
|
61
|
+
setIosHmsToken(token: string | null): void;
|
|
62
|
+
setApnsToken(token: string | null): void;
|
|
63
|
+
setRustoreToken(token: string | null): void;
|
|
64
|
+
pushSubscribe(sync: boolean | null, profileFields: {
|
|
65
|
+
[key: string]: string;
|
|
66
|
+
} | null, customFields: {
|
|
67
|
+
[key: string]: string;
|
|
68
|
+
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
69
|
+
pushSuspend(sync: boolean | null, profileFields: {
|
|
70
|
+
[key: string]: string;
|
|
71
|
+
} | null, customFields: {
|
|
72
|
+
[key: string]: string;
|
|
73
|
+
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
74
|
+
pushUnSubscribe(sync: boolean | null, profileFields: {
|
|
75
|
+
[key: string]: string;
|
|
76
|
+
} | null, customFields: {
|
|
77
|
+
[key: string]: string;
|
|
78
|
+
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
79
|
+
unSuspendPushSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
80
|
+
getStatusOfLatestSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
81
|
+
getStatusOfLatestSubscriptionForProvider(provider: string | null): Promise<ResponseWithHttpCode | null>;
|
|
82
|
+
getStatusForCurrentSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
83
|
+
takePush(message: {
|
|
84
|
+
[key: string]: string;
|
|
85
|
+
} | null): void;
|
|
86
|
+
subscribeToEvents(): void;
|
|
87
|
+
unsubscribeFromEvent(): void;
|
|
88
|
+
addListener(eventName: string): void;
|
|
89
|
+
removeListeners(count: number): void;
|
|
90
|
+
getPushToken(): Promise<TokenData | null>;
|
|
91
|
+
deleteDeviceToken(provider: string | null): Promise<void>;
|
|
92
|
+
forcedTokenUpdate(): Promise<void>;
|
|
93
|
+
changePushProviderPriorityList(priorityList: string[] | null): Promise<void>;
|
|
94
|
+
setPushToken(provider: string, token: string | null): Promise<void>;
|
|
95
|
+
clear(): Promise<void>;
|
|
96
|
+
reinitializeRetryControlInThisSession(): void;
|
|
97
|
+
requestNotificationPermission(): void;
|
|
98
|
+
mobileEvent(sid: string, eventName: string, sendMessageId: string | null, payload: {
|
|
99
|
+
[key: string]: string;
|
|
100
|
+
} | null, matching: {
|
|
101
|
+
[key: string]: string;
|
|
102
|
+
} | null, matchingType: string | null, profileFields: {
|
|
103
|
+
[key: string]: string;
|
|
104
|
+
} | null): void;
|
|
105
|
+
deliveryEvent(message: {
|
|
106
|
+
[key: string]: string;
|
|
107
|
+
} | null, messageUID: string | null): void;
|
|
108
|
+
openEvent(message: {
|
|
109
|
+
[key: string]: string;
|
|
110
|
+
} | null, messageUID: string | null): void;
|
|
111
|
+
}
|
|
112
|
+
declare const NativeSDK: Spec;
|
|
113
|
+
export default NativeSDK;
|
|
114
|
+
//# sourceMappingURL=NativeSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeSdk.d.ts","sourceRoot":"","sources":["../../../src/NativeSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAIrE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAA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,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,EACzC,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,IAAI,CAAC;CACT;AAID,QAAA,MAAM,SAAS,MAAgD,CAAC;AAChE,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { type AltcraftConfig, type CategoryData, type ResponseWithHttpCode, type TokenData } from './NativeSdk';
|
|
2
|
+
/**
|
|
3
|
+
* SDK event payload emitted from the native layer via NativeEventEmitter.
|
|
4
|
+
*
|
|
5
|
+
* Native sources (conceptually):
|
|
6
|
+
* - Android (Kotlin): SDK Events module -> emits "AltcraftSdkEvent"
|
|
7
|
+
* - iOS (Swift): SDKEvents.shared -> bridge -> emits "AltcraftSdkEvent"
|
|
8
|
+
*
|
|
9
|
+
* Fields:
|
|
10
|
+
* - function: origin function/context name in the SDK
|
|
11
|
+
* - code: optional numeric code (HTTP/internal/etc.)
|
|
12
|
+
* - message: human-readable message
|
|
13
|
+
* - type: event category ("event" | "error" | "retryError")
|
|
14
|
+
* - value: optional extra data/context
|
|
15
|
+
*/
|
|
16
|
+
export type SdkEvent = {
|
|
17
|
+
function: string;
|
|
18
|
+
code: number | null;
|
|
19
|
+
message: string;
|
|
20
|
+
type: 'event' | 'error' | 'retryError';
|
|
21
|
+
value?: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* JS-side abstraction for handling incoming push payloads.
|
|
27
|
+
*
|
|
28
|
+
* Native analogy:
|
|
29
|
+
* - Android: `AltcraftSDK.PushReceiver` + `PushReceiver.takePush(context, message)`
|
|
30
|
+
*
|
|
31
|
+
* In RN:
|
|
32
|
+
* - `takePush(...)` always forwards the payload to native (`NativeSdk.takePush`)
|
|
33
|
+
* - then optionally dispatches it to registered JS receivers (`PushReceiver`)
|
|
34
|
+
*
|
|
35
|
+
* This provides:
|
|
36
|
+
* - centralized forwarding to the Altcraft native SDK (parsing/internal flows)
|
|
37
|
+
* - optional additional JS-level handling (logging, routing, analytics, debugging)
|
|
38
|
+
*/
|
|
39
|
+
export declare abstract class PushReceiver {
|
|
40
|
+
/**
|
|
41
|
+
* Called when the JS facade receives a push payload.
|
|
42
|
+
*
|
|
43
|
+
* @param message Flat `Record<string, string>` (matches typical data payload shape).
|
|
44
|
+
*/
|
|
45
|
+
abstract pushHandler(message: {
|
|
46
|
+
[key: string]: string;
|
|
47
|
+
}): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Registers a JS receiver for incoming push payloads.
|
|
51
|
+
*
|
|
52
|
+
* Typically called once during app startup.
|
|
53
|
+
*
|
|
54
|
+
* @param receiver Implementation of `PushReceiver`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function registerPushReceiver(receiver: PushReceiver): void;
|
|
57
|
+
/**
|
|
58
|
+
* Clears all registered push receivers.
|
|
59
|
+
*
|
|
60
|
+
* Useful for tests or reinitializing the integration layer.
|
|
61
|
+
*/
|
|
62
|
+
export declare function clearPushReceivers(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Forwards an incoming push payload to the native Altcraft SDK and then to JS receivers.
|
|
65
|
+
*
|
|
66
|
+
* Native analogy:
|
|
67
|
+
* - Android: `AltcraftSDK.PushReceiver.takePush(context, message)`
|
|
68
|
+
*
|
|
69
|
+
* Important:
|
|
70
|
+
* - This method does NOT intercept notifications by itself.
|
|
71
|
+
* Platform-level interception must be implemented separately:
|
|
72
|
+
* - Android: FCM/HMS service -> call `takePush(message.data)`
|
|
73
|
+
* - iOS: AppDelegate / UNUserNotificationCenter / Notification Service Extension -> call `takePush(userInfo)`
|
|
74
|
+
*
|
|
75
|
+
* @param message Flat push payload map. Empty payloads are ignored.
|
|
76
|
+
*/
|
|
77
|
+
export declare function takePush(message: {
|
|
78
|
+
[key: string]: string;
|
|
79
|
+
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* Subscribes to Altcraft SDK events and starts streaming them from native to JS.
|
|
82
|
+
*
|
|
83
|
+
* Contract:
|
|
84
|
+
* - If a previous subscription exists, it is removed.
|
|
85
|
+
* - Calls `NativeSdk.subscribeToEvents()` so the native side starts emitting events.
|
|
86
|
+
*
|
|
87
|
+
* @param handler JS handler invoked for each SDK event.
|
|
88
|
+
*/
|
|
89
|
+
export declare function subscribeToEvents(handler: (event: SdkEvent) => void): void;
|
|
90
|
+
/**
|
|
91
|
+
* Unsubscribes from Altcraft SDK events.
|
|
92
|
+
*
|
|
93
|
+
* Behavior:
|
|
94
|
+
* - removes the JS listener
|
|
95
|
+
* - calls `NativeSdk.unsubscribeFromEvent()` to stop native emissions
|
|
96
|
+
*/
|
|
97
|
+
export declare function unsubscribeFromEvent(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Initializes the Altcraft SDK.
|
|
100
|
+
*
|
|
101
|
+
* Native equivalents:
|
|
102
|
+
* - Android: `AltcraftSDK.initialization(context, configuration, complete)`
|
|
103
|
+
* - iOS: `AltcraftSDK.shared.initialization(configuration, completion)`
|
|
104
|
+
*
|
|
105
|
+
* Promise:
|
|
106
|
+
* - resolves on success
|
|
107
|
+
*
|
|
108
|
+
* ⚠️ Can throw (reject):
|
|
109
|
+
* - configuration mapping/validation errors on native side
|
|
110
|
+
* - native initialization failure (e.g. missing required fields, internal init error)
|
|
111
|
+
*
|
|
112
|
+
* @param config SDK configuration (apiUrl is required).
|
|
113
|
+
*/
|
|
114
|
+
export declare function initialize(config: AltcraftConfig): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Sets/clears the JWT used by the SDK for authenticated requests.
|
|
117
|
+
*
|
|
118
|
+
* Native concept:
|
|
119
|
+
* - Android/iOS register a JWT provider; RN uses an internal provider backed by this token.
|
|
120
|
+
*
|
|
121
|
+
* Semantics:
|
|
122
|
+
* - token === null -> clear JWT provider/token
|
|
123
|
+
* - token !== null -> store token and enable provider
|
|
124
|
+
*
|
|
125
|
+
* @param token JWT string or null to clear.
|
|
126
|
+
*/
|
|
127
|
+
export declare function setJwt(token: string | null): void;
|
|
128
|
+
/**
|
|
129
|
+
* Android-only: sets the FCM token to be used by the SDK.
|
|
130
|
+
*
|
|
131
|
+
* Typical usage:
|
|
132
|
+
* - after `messaging().getToken()`
|
|
133
|
+
* - when the token refreshes
|
|
134
|
+
*
|
|
135
|
+
* @param token FCM token or null to clear/unset.
|
|
136
|
+
*/
|
|
137
|
+
export declare function setAndroidFcmToken(token: string | null): void;
|
|
138
|
+
/**
|
|
139
|
+
* iOS-only: kept for API symmetry (may be a no-op on other platforms).
|
|
140
|
+
*
|
|
141
|
+
* @param token iOS FCM token or null.
|
|
142
|
+
*/
|
|
143
|
+
export declare function setIosFcmToken(token: string | null): void;
|
|
144
|
+
/**
|
|
145
|
+
* Android-only: sets the HMS token.
|
|
146
|
+
*
|
|
147
|
+
* @param token HMS token or null.
|
|
148
|
+
*/
|
|
149
|
+
export declare function setAndroidHmsToken(token: string | null): void;
|
|
150
|
+
/**
|
|
151
|
+
* iOS-only: kept for API symmetry (may be a no-op on other platforms).
|
|
152
|
+
*
|
|
153
|
+
* @param token iOS HMS token or null.
|
|
154
|
+
*/
|
|
155
|
+
export declare function setIosHmsToken(token: string | null): void;
|
|
156
|
+
/**
|
|
157
|
+
* iOS-only: sets the APNs token (usually forwarded from AppDelegate).
|
|
158
|
+
*
|
|
159
|
+
* Note:
|
|
160
|
+
* - APNs token is commonly represented as a hex string on native side.
|
|
161
|
+
*
|
|
162
|
+
* @param token APNs token as hex string or null.
|
|
163
|
+
*/
|
|
164
|
+
export declare function setApnsToken(token: string | null): void;
|
|
165
|
+
/**
|
|
166
|
+
* Android-only: sets the RuStore token.
|
|
167
|
+
*
|
|
168
|
+
* @param token RuStore token or null.
|
|
169
|
+
*/
|
|
170
|
+
export declare function setRustoreToken(token: string | null): void;
|
|
171
|
+
/**
|
|
172
|
+
* Performs a push subscribe request.
|
|
173
|
+
*
|
|
174
|
+
* Notes:
|
|
175
|
+
* - fire-and-forget: results/errors are delivered via the SDK Events stream
|
|
176
|
+
* - `sync` is forwarded to the SDK/server semantics
|
|
177
|
+
*/
|
|
178
|
+
export declare function pushSubscribe(sync?: boolean | null, profileFields?: {
|
|
179
|
+
[key: string]: any;
|
|
180
|
+
} | null, customFields?: {
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
} | null, cats?: CategoryData[] | null, replace?: boolean | null, skipTriggers?: boolean | null): void;
|
|
183
|
+
/**
|
|
184
|
+
* Suspends push notifications for the current profile/subscription.
|
|
185
|
+
*
|
|
186
|
+
* Same parameter semantics as `pushSubscribe`.
|
|
187
|
+
* Results/errors are delivered via the SDK Events stream.
|
|
188
|
+
*/
|
|
189
|
+
export declare function pushSuspend(sync?: boolean | null, profileFields?: {
|
|
190
|
+
[key: string]: any;
|
|
191
|
+
} | null, customFields?: {
|
|
192
|
+
[key: string]: any;
|
|
193
|
+
} | null, cats?: CategoryData[] | null, replace?: boolean | null, skipTriggers?: boolean | null): void;
|
|
194
|
+
/**
|
|
195
|
+
* Performs a push unsubscribe request.
|
|
196
|
+
*
|
|
197
|
+
* Same parameter semantics as `pushSubscribe`.
|
|
198
|
+
* Results/errors are delivered via the SDK Events stream.
|
|
199
|
+
*/
|
|
200
|
+
export declare function pushUnSubscribe(sync?: boolean | null, profileFields?: {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
} | null, customFields?: {
|
|
203
|
+
[key: string]: any;
|
|
204
|
+
} | null, cats?: CategoryData[] | null, replace?: boolean | null, skipTriggers?: boolean | null): void;
|
|
205
|
+
/**
|
|
206
|
+
* Sends an "unSuspend" request and returns the response wrapped with HTTP status code.
|
|
207
|
+
*
|
|
208
|
+
* ⚠️ Can throw (reject):
|
|
209
|
+
* - native validation failure (missing data to create request)
|
|
210
|
+
* - request creation/sending failures
|
|
211
|
+
* - unexpected native exceptions
|
|
212
|
+
*
|
|
213
|
+
* @returns `ResponseWithHttpCode | null`
|
|
214
|
+
*/
|
|
215
|
+
export declare function unSuspendPushSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
216
|
+
/**
|
|
217
|
+
* Returns the status of the latest subscription request stored in the profile.
|
|
218
|
+
*
|
|
219
|
+
* ⚠️ Can throw (reject) on native request creation/sending failures or unexpected exceptions.
|
|
220
|
+
*/
|
|
221
|
+
export declare function getStatusOfLatestSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the status of the latest subscription for the specified provider.
|
|
224
|
+
* If provider is null, native SDK may use the current provider (SDK-specific).
|
|
225
|
+
*
|
|
226
|
+
* ⚠️ Can throw (reject):
|
|
227
|
+
* - invalid provider
|
|
228
|
+
* - native request creation/sending failures
|
|
229
|
+
* - unexpected native exceptions
|
|
230
|
+
*
|
|
231
|
+
* @param provider Provider identifier or null.
|
|
232
|
+
*/
|
|
233
|
+
export declare function getStatusOfLatestSubscriptionForProvider(provider?: string | null): Promise<ResponseWithHttpCode | null>;
|
|
234
|
+
/**
|
|
235
|
+
* Returns the status for the "current subscription context" (current provider + current token),
|
|
236
|
+
* according to native SDK rules.
|
|
237
|
+
*
|
|
238
|
+
* ⚠️ Can throw (reject) on native request creation/sending failures or unexpected exceptions.
|
|
239
|
+
*/
|
|
240
|
+
export declare function getStatusForCurrentSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
241
|
+
/**
|
|
242
|
+
* Returns the current push token selected/managed by the SDK.
|
|
243
|
+
*
|
|
244
|
+
* ⚠️ Can throw (reject) on unexpected native errors.
|
|
245
|
+
*
|
|
246
|
+
* May resolve `null` if token is not yet available or providers are not configured.
|
|
247
|
+
*/
|
|
248
|
+
export declare function getPushToken(): Promise<TokenData | null>;
|
|
249
|
+
/**
|
|
250
|
+
* Deletes the device token for a given provider.
|
|
251
|
+
*
|
|
252
|
+
* ⚠️ Can throw (reject):
|
|
253
|
+
* - provider is null/invalid
|
|
254
|
+
* - native deletion flow fails
|
|
255
|
+
* - unexpected native exceptions
|
|
256
|
+
*
|
|
257
|
+
* @param provider Provider identifier (or null; native may treat this as invalid).
|
|
258
|
+
*/
|
|
259
|
+
export declare function deleteDeviceToken(provider: string | null): Promise<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Forces a token refresh flow.
|
|
262
|
+
*
|
|
263
|
+
* ⚠️ Can throw (reject) on native failures or unexpected exceptions.
|
|
264
|
+
*/
|
|
265
|
+
export declare function forcedTokenUpdate(): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Updates the provider priority list used by the SDK to select a push provider.
|
|
268
|
+
*
|
|
269
|
+
* ⚠️ Can throw (reject):
|
|
270
|
+
* - invalid provider list (unknown identifiers)
|
|
271
|
+
* - native update flow failure
|
|
272
|
+
* - unexpected native exceptions
|
|
273
|
+
*
|
|
274
|
+
* @param priorityList Ordered list of provider IDs, or null.
|
|
275
|
+
*/
|
|
276
|
+
export declare function changePushProviderPriorityList(priorityList: string[] | null): Promise<void>;
|
|
277
|
+
/**
|
|
278
|
+
* Sets (or clears) a token for a specific provider.
|
|
279
|
+
|
|
280
|
+
*
|
|
281
|
+
* ⚠️ Can throw (reject):
|
|
282
|
+
* - provider is invalid/blank (native validation)
|
|
283
|
+
* - native set/delete flow fails
|
|
284
|
+
* - unexpected native exceptions
|
|
285
|
+
*
|
|
286
|
+
* @param provider Provider identifier.
|
|
287
|
+
* @param token Token string or null to clear.
|
|
288
|
+
*/
|
|
289
|
+
export declare function setPushToken(provider: string, token: string | null): Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* Clears SDK local state and stops active SDK background work (SDK-specific).
|
|
292
|
+
*
|
|
293
|
+
* ⚠️ Can throw (reject) on unexpected native errors.
|
|
294
|
+
*/
|
|
295
|
+
export declare function clear(): Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* Resets retry-control state in the current session to allow retry/re-init flows again.
|
|
298
|
+
* This is a session-level unlock, not a full SDK reset.
|
|
299
|
+
*/
|
|
300
|
+
export declare function reinitializeRetryControlInThisSession(): void;
|
|
301
|
+
/**
|
|
302
|
+
* Requests notification permission (where applicable).
|
|
303
|
+
*
|
|
304
|
+
* Note:
|
|
305
|
+
* - Usually no Promise here; native may silently no-op if not supported.
|
|
306
|
+
*/
|
|
307
|
+
export declare function requestNotificationPermission(): void;
|
|
308
|
+
/**
|
|
309
|
+
* Sends a "mobile event" (non-push event) to Altcraft backend.
|
|
310
|
+
*
|
|
311
|
+
* Note:
|
|
312
|
+
* - This is fire-and-forget and does not return a Promise.
|
|
313
|
+
* - Any errors are expected to be surfaced via SDK Events stream (if enabled) or native logs.
|
|
314
|
+
*/
|
|
315
|
+
export declare function mobileEvent(sid: string, eventName: string, sendMessageId?: string | null, payload?: {
|
|
316
|
+
[key: string]: any;
|
|
317
|
+
} | null, matching?: {
|
|
318
|
+
[key: string]: any;
|
|
319
|
+
} | null, matchingType?: string | null, profileFields?: {
|
|
320
|
+
[key: string]: any;
|
|
321
|
+
} | null): void;
|
|
322
|
+
/**
|
|
323
|
+
* Manually registers a "delivery" event for a push notification.
|
|
324
|
+
*
|
|
325
|
+
* Note:
|
|
326
|
+
* - Fire-and-forget (no Promise). Native errors should be emitted as SDK events or logs.
|
|
327
|
+
*/
|
|
328
|
+
export declare function deliveryEvent(message?: {
|
|
329
|
+
[key: string]: string;
|
|
330
|
+
} | null, messageUID?: string | null): void;
|
|
331
|
+
/**
|
|
332
|
+
* Manually registers an "open" event for a push notification.
|
|
333
|
+
*
|
|
334
|
+
* Note:
|
|
335
|
+
* - Fire-and-forget (no Promise). Native errors should be emitted as SDK events or logs.
|
|
336
|
+
*/
|
|
337
|
+
export declare function openEvent(message?: {
|
|
338
|
+
[key: string]: string;
|
|
339
|
+
} | null, messageUID?: string | null): void;
|
|
340
|
+
/**
|
|
341
|
+
* Public React Native facade for the Altcraft SDK.
|
|
342
|
+
*
|
|
343
|
+
* Promise-returning methods (can throw on `await` / reject):
|
|
344
|
+
* - initialize
|
|
345
|
+
* - unSuspendPushSubscription
|
|
346
|
+
* - getStatusOfLatestSubscription
|
|
347
|
+
* - getStatusOfLatestSubscriptionForProvider
|
|
348
|
+
* - getStatusForCurrentSubscription
|
|
349
|
+
* - getPushToken
|
|
350
|
+
* - deleteDeviceToken
|
|
351
|
+
* - forcedTokenUpdate
|
|
352
|
+
* - changePushProviderPriorityList
|
|
353
|
+
* - setPushToken
|
|
354
|
+
* - clear
|
|
355
|
+
*/
|
|
356
|
+
declare const AltcraftSDK: {
|
|
357
|
+
initialize: typeof initialize;
|
|
358
|
+
setJwt: typeof setJwt;
|
|
359
|
+
setAndroidFcmToken: typeof setAndroidFcmToken;
|
|
360
|
+
setIosFcmToken: typeof setIosFcmToken;
|
|
361
|
+
setAndroidHmsToken: typeof setAndroidHmsToken;
|
|
362
|
+
setIosHmsToken: typeof setIosHmsToken;
|
|
363
|
+
setApnsToken: typeof setApnsToken;
|
|
364
|
+
setRustoreToken: typeof setRustoreToken;
|
|
365
|
+
pushSubscribe: typeof pushSubscribe;
|
|
366
|
+
pushSuspend: typeof pushSuspend;
|
|
367
|
+
pushUnSubscribe: typeof pushUnSubscribe;
|
|
368
|
+
unSuspendPushSubscription: typeof unSuspendPushSubscription;
|
|
369
|
+
getStatusOfLatestSubscription: typeof getStatusOfLatestSubscription;
|
|
370
|
+
getStatusOfLatestSubscriptionForProvider: typeof getStatusOfLatestSubscriptionForProvider;
|
|
371
|
+
getStatusForCurrentSubscription: typeof getStatusForCurrentSubscription;
|
|
372
|
+
getPushToken: typeof getPushToken;
|
|
373
|
+
deleteDeviceToken: typeof deleteDeviceToken;
|
|
374
|
+
forcedTokenUpdate: typeof forcedTokenUpdate;
|
|
375
|
+
changePushProviderPriorityList: typeof changePushProviderPriorityList;
|
|
376
|
+
setPushToken: typeof setPushToken;
|
|
377
|
+
clear: typeof clear;
|
|
378
|
+
reinitializeRetryControlInThisSession: typeof reinitializeRetryControlInThisSession;
|
|
379
|
+
requestNotificationPermission: typeof requestNotificationPermission;
|
|
380
|
+
mobileEvent: typeof mobileEvent;
|
|
381
|
+
PushReceiver: typeof PushReceiver;
|
|
382
|
+
registerPushReceiver: typeof registerPushReceiver;
|
|
383
|
+
clearPushReceivers: typeof clearPushReceivers;
|
|
384
|
+
takePush: typeof takePush;
|
|
385
|
+
subscribeToEvents: typeof subscribeToEvents;
|
|
386
|
+
unsubscribeFromEvent: typeof unsubscribeFromEvent;
|
|
387
|
+
deliveryEvent: typeof deliveryEvent;
|
|
388
|
+
openEvent: typeof openEvent;
|
|
389
|
+
};
|
|
390
|
+
export default AltcraftSDK;
|
|
391
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAkB,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC;IACvC,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;CACvC,CAAC;AA4BF;;;;;;;;;;;;;GAaG;AACH,8BAAsB,YAAY;IAChC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;CAC/D;AAQD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAaD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE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O,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,IAAW,EAChD,UAAU,GAAE,MAAM,GAAG,IAAW,GAC/B,IAAI,CAKN;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,IAAW,EAChD,UAAU,GAAE,MAAM,GAAG,IAAW,GAC/B,IAAI,CAKN;AAID;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@altcraft/react-native-sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Altcraft Platform SDK for React Native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace react-native-sdk-example",
|
|
36
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\""
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"react-native",
|
|
43
|
+
"altcraft",
|
|
44
|
+
"push",
|
|
45
|
+
"sdk"
|
|
46
|
+
],
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/altcraft/react-native-sdk.git"
|
|
50
|
+
},
|
|
51
|
+
"author": "Altcraft <contact@altcraft.com> (https://altcraft.com)",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/altcraft/react-native-sdk/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/altcraft/react-native-sdk#readme",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"registry": "https://registry.npmjs.org/"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@eslint/compat": "^1.3.2",
|
|
62
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
63
|
+
"@eslint/js": "^9.35.0",
|
|
64
|
+
"@react-native-community/cli": "20.0.1",
|
|
65
|
+
"@react-native/babel-preset": "0.81.1",
|
|
66
|
+
"@react-native/eslint-config": "^0.81.1",
|
|
67
|
+
"@types/react": "^19.1.0",
|
|
68
|
+
"del-cli": "^6.0.0",
|
|
69
|
+
"eslint": "^9.35.0",
|
|
70
|
+
"eslint-config-prettier": "^10.1.8",
|
|
71
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
72
|
+
"prettier": "^3.0.0",
|
|
73
|
+
"react": "19.1.0",
|
|
74
|
+
"react-native": "0.81.1",
|
|
75
|
+
"react-native-builder-bob": "^0.40.16",
|
|
76
|
+
"turbo": "^2.5.6",
|
|
77
|
+
"typescript": "^5.9.2"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"react": "*",
|
|
81
|
+
"react-native": "*"
|
|
82
|
+
},
|
|
83
|
+
"workspaces": [
|
|
84
|
+
"example"
|
|
85
|
+
],
|
|
86
|
+
"packageManager": "yarn@4.11.0",
|
|
87
|
+
"react-native-builder-bob": {
|
|
88
|
+
"source": "src",
|
|
89
|
+
"output": "lib",
|
|
90
|
+
"targets": [
|
|
91
|
+
[
|
|
92
|
+
"module",
|
|
93
|
+
{
|
|
94
|
+
"esm": true
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"typescript",
|
|
99
|
+
{
|
|
100
|
+
"project": "tsconfig.build.json"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"codegenConfig": {
|
|
106
|
+
"name": "Sdk",
|
|
107
|
+
"type": "modules",
|
|
108
|
+
"jsSrcsDir": "src",
|
|
109
|
+
"android": {
|
|
110
|
+
"javaPackageName": "com.altcraft.sdk"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"prettier": {
|
|
114
|
+
"quoteProps": "consistent",
|
|
115
|
+
"singleQuote": true,
|
|
116
|
+
"tabWidth": 2,
|
|
117
|
+
"trailingComma": "es5",
|
|
118
|
+
"useTabs": false
|
|
119
|
+
},
|
|
120
|
+
"create-react-native-library": {
|
|
121
|
+
"languages": "kotlin-objc",
|
|
122
|
+
"type": "turbo-module",
|
|
123
|
+
"tools": [
|
|
124
|
+
"eslint"
|
|
125
|
+
],
|
|
126
|
+
"version": "0.55.1"
|
|
127
|
+
}
|
|
128
|
+
}
|