react-native-acoustic-connect-beta 18.0.25 → 18.0.27
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/AcousticConnectRN.podspec +4 -1
- package/android/src/main/assets/ConnectBasicConfig.properties +1 -1
- package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +54 -0
- package/ios/HybridAcousticConnectRN.swift +177 -0
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +109 -0
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/AcousticConnectRN+autolinking.cmake +1 -0
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +137 -1
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +7 -0
- package/nitrogen/generated/android/c++/JPushErrorInfo.hpp +66 -0
- package/nitrogen/generated/android/c++/JPushPermissionResult.hpp +66 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushErrorInfo.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushPermissionResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/Variant_NullType_Boolean.kt +62 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.cpp +32 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.hpp +249 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Umbrella.hpp +8 -0
- package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +67 -1
- package/nitrogen/generated/ios/swift/Func_void_PushPermissionResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__bool_.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +7 -0
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +205 -0
- package/nitrogen/generated/ios/swift/PushErrorInfo.swift +65 -0
- package/nitrogen/generated/ios/swift/PushPermissionResult.swift +66 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_Bool.swift +30 -0
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.cpp +7 -0
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +15 -1
- package/nitrogen/generated/shared/c++/PushErrorInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/PushPermissionResult.hpp +90 -0
- package/package.json +1 -1
- package/src/specs/react-native-acoustic-connect.nitro.ts +128 -0
|
@@ -20,6 +20,38 @@ export type KeyValueObject = {
|
|
|
20
20
|
|
|
21
21
|
export type ConnectMonitoringLevelType = 'Ignore' | 'CellularAndWiFi' | 'WiFi'
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Structured error describing an APNs / permission failure.
|
|
25
|
+
*
|
|
26
|
+
* Mirrors the `firebase-messaging` / `notifee` ecosystem convention so callers
|
|
27
|
+
* can forward a native error object without string-encoding it. The native
|
|
28
|
+
* bridge reconstructs an `NSError` (iOS) from these fields.
|
|
29
|
+
*/
|
|
30
|
+
export interface PushErrorInfo {
|
|
31
|
+
/** Platform error code, when available (maps to `NSError.code`). */
|
|
32
|
+
code?: number
|
|
33
|
+
/** Platform error domain, when available (maps to `NSError.domain`). */
|
|
34
|
+
domain?: string
|
|
35
|
+
/** Human-readable failure description (maps to `NSLocalizedDescriptionKey`). */
|
|
36
|
+
message: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Result of a permission request.
|
|
41
|
+
*
|
|
42
|
+
* The Promise from {@link AcousticConnectRN.pushRequestPermission} always
|
|
43
|
+
* resolves with this shape and never rejects. `error` is `null` on success or
|
|
44
|
+
* a denial with no system error; a non-null string carries the system error's
|
|
45
|
+
* localized description, or `'permission-prompt-abandoned'` if the host was
|
|
46
|
+
* destroyed mid-prompt.
|
|
47
|
+
*/
|
|
48
|
+
export interface PushPermissionResult {
|
|
49
|
+
/** `true` if the user granted permission, `false` otherwise. */
|
|
50
|
+
granted: boolean
|
|
51
|
+
/** `null` on success/clean denial; otherwise a description of the error. */
|
|
52
|
+
error?: string | null
|
|
53
|
+
}
|
|
54
|
+
|
|
23
55
|
export interface AcousticConnectRN extends HybridObject<{ ios: 'swift', android: 'kotlin' }> {
|
|
24
56
|
/**
|
|
25
57
|
* Re-enables the Connect SDK after a prior {@link disable} call.
|
|
@@ -107,4 +139,100 @@ export interface AcousticConnectRN extends HybridObject<{ ios: 'swift', android:
|
|
|
107
139
|
logDialogDismissEvent(dialogId: string, dismissReason: string): boolean
|
|
108
140
|
logDialogButtonClickEvent(dialogId: string, buttonText: string, buttonIndex: number): boolean
|
|
109
141
|
logDialogCustomEvent(dialogId: string, eventName: string, values: Record<string, string | number | boolean>): boolean
|
|
142
|
+
|
|
143
|
+
// ── Push: APNs lifecycle (iOS) ──────────────────────────────────────────
|
|
144
|
+
//
|
|
145
|
+
// Push mode (automatic / manual / off) is configured in `ConnectConfig.json`
|
|
146
|
+
// and enforced by the native SDK — there is no JS-side mode argument. In
|
|
147
|
+
// automatic mode the SDK's swizzled delegate handles everything and these
|
|
148
|
+
// forwarding calls are redundant-but-safe; in manual mode they are the only
|
|
149
|
+
// path for events to reach the SDK.
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Forwards the raw APNs device token to the Connect SDK (manual mode).
|
|
153
|
+
*
|
|
154
|
+
* Nitro maps `ArrayBuffer` ↔ `Data` natively; the bridge forwards the bytes
|
|
155
|
+
* unchanged with no hex conversion and no validation.
|
|
156
|
+
*
|
|
157
|
+
* @param deviceToken Raw APNs device-token bytes from
|
|
158
|
+
* `didRegisterForRemoteNotificationsWithDeviceToken`.
|
|
159
|
+
* @returns A promise resolving to `true` once the SDK accepted the token,
|
|
160
|
+
* or `false` if the SDK rejected the call (e.g. push not enabled). Never
|
|
161
|
+
* rejects.
|
|
162
|
+
*/
|
|
163
|
+
pushDidRegisterWithToken(deviceToken: ArrayBuffer): Promise<boolean>
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Forwards an APNs registration failure to the Connect SDK (manual mode).
|
|
167
|
+
*
|
|
168
|
+
* @param error Structured error; the bridge builds an `NSError` from it.
|
|
169
|
+
* @returns A promise resolving to `true` once forwarded, `false` on failure.
|
|
170
|
+
* Never rejects.
|
|
171
|
+
*/
|
|
172
|
+
pushDidFailToRegister(error: PushErrorInfo): Promise<boolean>
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Forwards a received notification to the Connect SDK so it can log a
|
|
176
|
+
* `pushReceived` signal (manual mode).
|
|
177
|
+
*
|
|
178
|
+
* The bridge branches on the push mode resolved from `ConnectConfig.json`:
|
|
179
|
+
* manual mode forwards to the SDK and returns `true`; automatic/off mode
|
|
180
|
+
* returns `false` (bridge error `EAC-RN-007`) without forwarding, because
|
|
181
|
+
* the SDK's own delegate already handles delivery in automatic mode and
|
|
182
|
+
* forwarding would double-log.
|
|
183
|
+
*
|
|
184
|
+
* @param userInfo The notification `userInfo` payload.
|
|
185
|
+
* @returns A promise resolving to `true` if processed (manual mode), or
|
|
186
|
+
* `false` in automatic/off mode (`EAC-RN-007`). Never rejects.
|
|
187
|
+
*/
|
|
188
|
+
pushDidReceiveNotification(userInfo: Record<string, string | number | boolean>): Promise<boolean>
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Forwards a notification response (tap / action) to the Connect SDK so it
|
|
192
|
+
* can run the built-in action and log a `pushAction` signal (manual mode).
|
|
193
|
+
*
|
|
194
|
+
* Same `EAC-RN-007` (`false`) behaviour in automatic mode as
|
|
195
|
+
* {@link pushDidReceiveNotification}.
|
|
196
|
+
*
|
|
197
|
+
* @param actionIdentifier The response action identifier.
|
|
198
|
+
* @param userInfo The notification `userInfo` payload.
|
|
199
|
+
* @returns A promise resolving to `true` if processed (manual mode), or
|
|
200
|
+
* `false` in automatic/off mode (`EAC-RN-007`). Never rejects.
|
|
201
|
+
*/
|
|
202
|
+
pushDidReceiveResponse(actionIdentifier: string, userInfo: Record<string, string | number | boolean>): Promise<boolean>
|
|
203
|
+
|
|
204
|
+
// ── Push: permission management (cross-platform) ────────────────────────
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Forwards externally-obtained permission state to the SDK.
|
|
208
|
+
*
|
|
209
|
+
* Tri-state `granted`: `true` granted, `false` denied, `null` not yet
|
|
210
|
+
* determined. For `null` the bridge records the state but does not call the
|
|
211
|
+
* SDK (it has no notion of forwarding "unknown").
|
|
212
|
+
*
|
|
213
|
+
* @param granted Tri-state permission value.
|
|
214
|
+
* @param error Optional structured error accompanying a denial.
|
|
215
|
+
* @returns A promise resolving to `true` once handled — including the
|
|
216
|
+
* `null`/not-determined case, which is intentionally accepted without
|
|
217
|
+
* forwarding to the SDK. `false` only if the SDK rejected a forwarded
|
|
218
|
+
* state. Never rejects.
|
|
219
|
+
*/
|
|
220
|
+
pushDidReceiveAuthorization(granted: boolean | null, error?: PushErrorInfo): Promise<boolean>
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Requests notification permission via the SDK, presenting the system prompt
|
|
224
|
+
* when undetermined.
|
|
225
|
+
*
|
|
226
|
+
* Always resolves, never rejects — see {@link PushPermissionResult}.
|
|
227
|
+
*
|
|
228
|
+
* @returns The permission result.
|
|
229
|
+
*/
|
|
230
|
+
pushRequestPermission(): Promise<PushPermissionResult>
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Reads the current notification permission state without prompting.
|
|
234
|
+
*
|
|
235
|
+
* @returns Tri-state: `true` granted, `false` denied, `null` not determined.
|
|
236
|
+
*/
|
|
237
|
+
pushGetPermissionState(): Promise<boolean | null>
|
|
110
238
|
}
|