@developer_tribe/react-native-comnyx 0.15.0 → 0.16.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/Comnyx.podspec +10 -2
- package/README.md +50 -0
- package/android/build.gradle +1 -0
- package/android/consumer-rules.pro +23 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +46 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +23 -1
- package/android/generated/jni/RNComnyxSpec.h +7 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +21 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +70 -0
- package/android/src/main/AndroidManifest.xml +11 -1
- package/android/src/main/AndroidManifestNew.xml +11 -1
- package/android/src/main/java/com/comnyx/ComnyxMediaPickerModule.kt +91 -51
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +7 -0
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FirebaseMessagingService.kt +4 -6
- package/android/src/main/res/xml/comnyx_file_paths.xml +12 -0
- package/ios/APNService.swift +9 -9
- package/ios/Comnyx.swift +17 -8
- package/ios/ComnyxMediaPicker.swift +47 -26
- package/ios/ComnyxMessaging.swift +2 -0
- package/ios/PrivacyInfo.xcprivacy +32 -0
- package/ios/comnyx_post_install.rb +25 -0
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +53 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +67 -0
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +38 -0
- package/ios/generated/RNComnyxSpecJSI.h +89 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/NativeComnyxMediaPicker.js +19 -0
- package/lib/commonjs/NativeComnyxMediaPicker.js.map +1 -1
- package/lib/commonjs/api/conversations.js +6 -6
- package/lib/commonjs/api/conversations.js.map +1 -1
- package/lib/commonjs/api/customers.js +3 -2
- package/lib/commonjs/api/customers.js.map +1 -1
- package/lib/commonjs/api/media.js +20 -6
- package/lib/commonjs/api/media.js.map +1 -1
- package/lib/commonjs/api/messages.js +3 -2
- package/lib/commonjs/api/messages.js.map +1 -1
- package/lib/commonjs/components/ChatList.js +93 -45
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/ComnyxErrorBoundary.js +92 -0
- package/lib/commonjs/components/ComnyxErrorBoundary.js.map +1 -0
- package/lib/commonjs/components/CustomerForm.js +2 -2
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/MediaMessageItem.js +4 -3
- package/lib/commonjs/components/MediaMessageItem.js.map +1 -1
- package/lib/commonjs/components/MessageInput.js +63 -13
- package/lib/commonjs/components/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageItem.js +1 -1
- package/lib/commonjs/components/MessageItem.js.map +1 -1
- package/lib/commonjs/hooks/usePolling.js +25 -21
- package/lib/commonjs/hooks/usePolling.js.map +1 -1
- package/lib/commonjs/hooks/useThemeColors.js +12 -1
- package/lib/commonjs/hooks/useThemeColors.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/initializeNotifications.js +19 -16
- package/lib/commonjs/notifications/initializeNotifications.js.map +1 -1
- package/lib/commonjs/register/Accumulator.js +19 -6
- package/lib/commonjs/register/Accumulator.js.map +1 -1
- package/lib/commonjs/register/collectData.js +1 -1
- package/lib/commonjs/register/collectData.js.map +1 -1
- package/lib/commonjs/store/store.js +6 -0
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/commonjs/support/ComnyxSupport.js +60 -15
- package/lib/commonjs/support/ComnyxSupport.js.map +1 -1
- package/lib/commonjs/support/SupportConfigContext.js +24 -0
- package/lib/commonjs/support/SupportConfigContext.js.map +1 -0
- package/lib/commonjs/types/Theme.js +30 -2
- package/lib/commonjs/types/Theme.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/NativeComnyxMediaPicker.js +18 -0
- package/lib/module/NativeComnyxMediaPicker.js.map +1 -1
- package/lib/module/api/conversations.js +6 -6
- package/lib/module/api/conversations.js.map +1 -1
- package/lib/module/api/customers.js +3 -2
- package/lib/module/api/customers.js.map +1 -1
- package/lib/module/api/media.js +21 -6
- package/lib/module/api/media.js.map +1 -1
- package/lib/module/api/messages.js +3 -2
- package/lib/module/api/messages.js.map +1 -1
- package/lib/module/components/ChatList.js +94 -46
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/ComnyxErrorBoundary.js +87 -0
- package/lib/module/components/ComnyxErrorBoundary.js.map +1 -0
- package/lib/module/components/CustomerForm.js +2 -2
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/MediaMessageItem.js +4 -3
- package/lib/module/components/MediaMessageItem.js.map +1 -1
- package/lib/module/components/MessageInput.js +64 -14
- package/lib/module/components/MessageInput.js.map +1 -1
- package/lib/module/components/MessageItem.js +1 -1
- package/lib/module/components/MessageItem.js.map +1 -1
- package/lib/module/hooks/usePolling.js +25 -21
- package/lib/module/hooks/usePolling.js.map +1 -1
- package/lib/module/hooks/useThemeColors.js +13 -2
- package/lib/module/hooks/useThemeColors.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/initializeNotifications.js +19 -16
- package/lib/module/notifications/initializeNotifications.js.map +1 -1
- package/lib/module/register/Accumulator.js +19 -6
- package/lib/module/register/Accumulator.js.map +1 -1
- package/lib/module/register/collectData.js +1 -1
- package/lib/module/register/collectData.js.map +1 -1
- package/lib/module/store/store.js +6 -0
- package/lib/module/store/store.js.map +1 -1
- package/lib/module/support/ComnyxSupport.js +61 -16
- package/lib/module/support/ComnyxSupport.js.map +1 -1
- package/lib/module/support/SupportConfigContext.js +19 -0
- package/lib/module/support/SupportConfigContext.js.map +1 -0
- package/lib/module/types/Theme.js +30 -2
- package/lib/module/types/Theme.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts +9 -0
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts.map +1 -1
- package/lib/typescript/src/api/conversations.d.ts +2 -2
- package/lib/typescript/src/api/conversations.d.ts.map +1 -1
- package/lib/typescript/src/api/customers.d.ts +1 -1
- package/lib/typescript/src/api/customers.d.ts.map +1 -1
- package/lib/typescript/src/api/media.d.ts +3 -3
- package/lib/typescript/src/api/media.d.ts.map +1 -1
- package/lib/typescript/src/api/messages.d.ts +1 -1
- package/lib/typescript/src/api/messages.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/components/ComnyxErrorBoundary.d.ts +18 -0
- package/lib/typescript/src/components/ComnyxErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaMessageItem.d.ts.map +1 -1
- package/lib/typescript/src/components/MessageInput.d.ts.map +1 -1
- package/lib/typescript/src/components/MessageItem.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePolling.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useThemeColors.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/notifications/initializeNotifications.d.ts.map +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts.map +1 -1
- package/lib/typescript/src/register/collectData.d.ts +4 -1
- package/lib/typescript/src/register/collectData.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts +6 -2
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/support/ComnyxSupport.d.ts +56 -2
- package/lib/typescript/src/support/ComnyxSupport.d.ts.map +1 -1
- package/lib/typescript/src/support/SupportConfigContext.d.ts +58 -0
- package/lib/typescript/src/support/SupportConfigContext.d.ts.map +1 -0
- package/lib/typescript/src/support/index.d.ts +1 -0
- package/lib/typescript/src/support/index.d.ts.map +1 -1
- package/lib/typescript/src/types/Conversation.d.ts +2 -2
- package/lib/typescript/src/types/Conversation.d.ts.map +1 -1
- package/lib/typescript/src/types/Customer.d.ts +1 -1
- package/lib/typescript/src/types/Customer.d.ts.map +1 -1
- package/lib/typescript/src/types/MessageResponse.d.ts +7 -4
- package/lib/typescript/src/types/MessageResponse.d.ts.map +1 -1
- package/lib/typescript/src/types/Theme.d.ts +26 -0
- package/lib/typescript/src/types/Theme.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +12 -25
- package/src/NativeComnyxMediaPicker.ts +18 -0
- package/src/api/conversations.ts +6 -4
- package/src/api/customers.ts +3 -1
- package/src/api/media.ts +32 -10
- package/src/api/messages.ts +3 -1
- package/src/components/ChatList.tsx +115 -55
- package/src/components/ComnyxErrorBoundary.tsx +91 -0
- package/src/components/CustomerForm.tsx +2 -2
- package/src/components/MediaMessageItem.tsx +10 -3
- package/src/components/MessageInput.tsx +89 -16
- package/src/components/MessageItem.tsx +12 -13
- package/src/hooks/usePolling.ts +21 -11
- package/src/hooks/useThemeColors.ts +11 -2
- package/src/index.ts +12 -0
- package/src/notifications/initializeNotifications.ts +22 -20
- package/src/register/Accumulator.ts +26 -9
- package/src/register/collectData.ts +10 -2
- package/src/store/store.ts +11 -3
- package/src/support/ComnyxSupport.tsx +128 -22
- package/src/support/SupportConfigContext.tsx +79 -0
- package/src/support/index.ts +7 -0
- package/src/types/Conversation.ts +2 -2
- package/src/types/Customer.ts +1 -2
- package/src/types/MessageResponse.ts +4 -4
- package/src/types/Theme.ts +38 -0
- package/src/version.ts +1 -1
package/ios/Comnyx.swift
CHANGED
|
@@ -19,7 +19,8 @@ public class Comnyx: RCTEventEmitter {
|
|
|
19
19
|
override init() {
|
|
20
20
|
super.init()
|
|
21
21
|
resetBadge()
|
|
22
|
-
self.comnyxMessaging = ComnyxMessaging(onNotificationReceived: { notification in
|
|
22
|
+
self.comnyxMessaging = ComnyxMessaging(onNotificationReceived: { [weak self] notification in
|
|
23
|
+
guard let self = self else { return }
|
|
23
24
|
let notificationData: [String: Any] = [
|
|
24
25
|
"title": notification.request.content.title,
|
|
25
26
|
"body": notification.request.content.body,
|
|
@@ -42,7 +43,8 @@ public class Comnyx: RCTEventEmitter {
|
|
|
42
43
|
]
|
|
43
44
|
]
|
|
44
45
|
self.sendEvent(withName: "NOTIFICATION_RECEIVED", body: ["notification": notificationData])
|
|
45
|
-
}, onNotificationClicked: { response in
|
|
46
|
+
}, onNotificationClicked: { [weak self] response in
|
|
47
|
+
guard let self = self else { return }
|
|
46
48
|
let responseData: [String: Any] = [
|
|
47
49
|
"title": response.notification.request.content.title,
|
|
48
50
|
"body": response.notification.request.content.body,
|
|
@@ -139,8 +141,12 @@ public class Comnyx: RCTEventEmitter {
|
|
|
139
141
|
let logLevel = options["logLevel"] as? String ?? "warn"
|
|
140
142
|
NSLog("Comnyx Log Level: \(logLevel) passed from JavaScript. It will be supported in the future.")
|
|
141
143
|
|
|
142
|
-
self.comnyxMessaging
|
|
144
|
+
guard let messaging = self.comnyxMessaging else {
|
|
145
|
+
reject("ERROR_NOT_READY", "Comnyx messaging layer is not initialized", nil)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
143
148
|
|
|
149
|
+
messaging.initialize(onInitialized: { initialized in
|
|
144
150
|
var countryCode = "US"
|
|
145
151
|
var language = "en"
|
|
146
152
|
if #available(iOS 16, *) {
|
|
@@ -158,7 +164,8 @@ public class Comnyx: RCTEventEmitter {
|
|
|
158
164
|
"timezone": timezone,
|
|
159
165
|
"language": language,
|
|
160
166
|
])
|
|
161
|
-
}, onApnTokenReceived: { type, token in
|
|
167
|
+
}, onApnTokenReceived: { [weak self] type, token in
|
|
168
|
+
guard let self = self else { return }
|
|
162
169
|
if(type == "failed"){
|
|
163
170
|
self.sendEvent(withName: "TOKEN_FAILED", body: ["type": type, "token": nil])
|
|
164
171
|
}else{
|
|
@@ -195,9 +202,10 @@ public class Comnyx: RCTEventEmitter {
|
|
|
195
202
|
@objc
|
|
196
203
|
public static func registerDeviceToken(_ deviceToken: Data) {
|
|
197
204
|
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
|
|
198
|
-
|
|
205
|
+
#if DEBUG
|
|
206
|
+
print("[Comnyx] Device Token: \(token)")
|
|
207
|
+
#endif
|
|
199
208
|
|
|
200
|
-
// Post notification for RCT modules to handle
|
|
201
209
|
NotificationCenter.default.post(
|
|
202
210
|
name: NSNotification.Name("RCTRemoteNotificationRegistered"),
|
|
203
211
|
object: self,
|
|
@@ -207,8 +215,9 @@ public class Comnyx: RCTEventEmitter {
|
|
|
207
215
|
|
|
208
216
|
@objc
|
|
209
217
|
public static func registerDeviceTokenFailed(_ error: Error) {
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
#if DEBUG
|
|
219
|
+
print("[Comnyx] Device Token Failed: \(error)")
|
|
220
|
+
#endif
|
|
212
221
|
NotificationCenter.default.post(
|
|
213
222
|
name: NSNotification.Name("RCTRemoteNotificationRegistrationFailed"),
|
|
214
223
|
object: self,
|
|
@@ -5,6 +5,13 @@ import AVFoundation
|
|
|
5
5
|
import AVKit
|
|
6
6
|
import React
|
|
7
7
|
|
|
8
|
+
@inline(__always)
|
|
9
|
+
private func comnyxMediaLog(_ message: @autoclosure () -> String) {
|
|
10
|
+
#if DEBUG
|
|
11
|
+
print(message())
|
|
12
|
+
#endif
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
@objc(ComnyxMediaPicker)
|
|
9
16
|
class ComnyxMediaPicker: NSObject, RCTBridgeModule {
|
|
10
17
|
|
|
@@ -303,7 +310,7 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
303
310
|
provider.loadFileRepresentation(forTypeIdentifier: "public.image") { [weak self] url, error in
|
|
304
311
|
defer { group.leave() }
|
|
305
312
|
guard let self = self, let sourceURL = url, error == nil else {
|
|
306
|
-
|
|
313
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image load failed: \(error?.localizedDescription ?? "no url")")
|
|
307
314
|
return
|
|
308
315
|
}
|
|
309
316
|
|
|
@@ -323,12 +330,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
323
330
|
"fileSize": finalData.count,
|
|
324
331
|
"mimeType": finalMimeType,
|
|
325
332
|
]
|
|
326
|
-
|
|
333
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image asset ready: \(asset)")
|
|
327
334
|
lock.lock()
|
|
328
335
|
allAssets.add(asset)
|
|
329
336
|
lock.unlock()
|
|
330
337
|
} catch {
|
|
331
|
-
|
|
338
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image processing error: \(error)")
|
|
332
339
|
}
|
|
333
340
|
}
|
|
334
341
|
continue
|
|
@@ -340,7 +347,7 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
340
347
|
provider.loadFileRepresentation(forTypeIdentifier: "public.movie") { [weak self] url, error in
|
|
341
348
|
defer { group.leave() }
|
|
342
349
|
guard let self = self, let sourceURL = url, error == nil else {
|
|
343
|
-
|
|
350
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video load failed: \(error?.localizedDescription ?? "no url")")
|
|
344
351
|
return
|
|
345
352
|
}
|
|
346
353
|
|
|
@@ -365,12 +372,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
365
372
|
if let thumb = thumbnailUri {
|
|
366
373
|
asset["thumbnailUri"] = thumb
|
|
367
374
|
}
|
|
368
|
-
|
|
375
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video asset ready: \(asset)")
|
|
369
376
|
lock.lock()
|
|
370
377
|
allAssets.add(asset)
|
|
371
378
|
lock.unlock()
|
|
372
379
|
} catch {
|
|
373
|
-
|
|
380
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video processing error: \(error)")
|
|
374
381
|
}
|
|
375
382
|
}
|
|
376
383
|
continue
|
|
@@ -378,12 +385,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
378
385
|
}
|
|
379
386
|
|
|
380
387
|
group.notify(queue: .main) { [weak self] in
|
|
381
|
-
|
|
388
|
+
comnyxMediaLog("[ComnyxMediaPicker] All assets processed. Count: \(allAssets.count)")
|
|
382
389
|
if allAssets.count == 0 {
|
|
383
390
|
self?.resolveBlock?(nil)
|
|
384
391
|
} else {
|
|
385
392
|
let result = allAssets.map { $0 }
|
|
386
|
-
|
|
393
|
+
comnyxMediaLog("[ComnyxMediaPicker] Resolving with \(result.count) assets")
|
|
387
394
|
self?.resolveBlock?(result)
|
|
388
395
|
}
|
|
389
396
|
self?.resolveBlock = nil
|
|
@@ -399,26 +406,40 @@ extension ComnyxMediaPicker: UIImagePickerControllerDelegate, UINavigationContro
|
|
|
399
406
|
picker.dismiss(animated: true)
|
|
400
407
|
|
|
401
408
|
if let imageURL = info[.imageURL] as? URL {
|
|
402
|
-
|
|
403
|
-
let
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
409
|
+
DispatchQueue.global(qos: .userInitiated).async { [weak self] in
|
|
410
|
+
guard let self = self else { return }
|
|
411
|
+
do {
|
|
412
|
+
let data = try Data(contentsOf: imageURL)
|
|
413
|
+
let (finalURL, finalData, finalMimeType) = self.compressImageIfNeeded(imageURL: imageURL, originalData: data)
|
|
414
|
+
DispatchQueue.main.async {
|
|
415
|
+
self.resolveWithAsset(url: finalURL, type: "image", mimeType: finalMimeType, fileSize: finalData.count)
|
|
416
|
+
}
|
|
417
|
+
} catch {
|
|
418
|
+
DispatchQueue.main.async {
|
|
419
|
+
self.rejectBlock?("FILE_ERROR", error.localizedDescription, error)
|
|
420
|
+
self.resolveBlock = nil
|
|
421
|
+
self.rejectBlock = nil
|
|
422
|
+
}
|
|
423
|
+
}
|
|
410
424
|
}
|
|
411
425
|
} else if let videoURL = info[.mediaURL] as? URL {
|
|
412
|
-
|
|
413
|
-
let
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
426
|
+
DispatchQueue.global(qos: .userInitiated).async { [weak self] in
|
|
427
|
+
guard let self = self else { return }
|
|
428
|
+
do {
|
|
429
|
+
let attrs = try FileManager.default.attributesOfItem(atPath: videoURL.path)
|
|
430
|
+
let fileSize = attrs[.size] as? Int ?? 0
|
|
431
|
+
let mime = self.mimeType(for: videoURL)
|
|
432
|
+
let thumbnailUri = self.generateVideoThumbnail(for: videoURL)
|
|
433
|
+
DispatchQueue.main.async {
|
|
434
|
+
self.resolveWithAsset(url: videoURL, type: "video", mimeType: mime, fileSize: fileSize, thumbnailUri: thumbnailUri)
|
|
435
|
+
}
|
|
436
|
+
} catch {
|
|
437
|
+
DispatchQueue.main.async {
|
|
438
|
+
self.rejectBlock?("FILE_ERROR", error.localizedDescription, error)
|
|
439
|
+
self.resolveBlock = nil
|
|
440
|
+
self.rejectBlock = nil
|
|
441
|
+
}
|
|
442
|
+
}
|
|
422
443
|
}
|
|
423
444
|
} else {
|
|
424
445
|
resolveBlock?(nil)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>NSPrivacyTracking</key>
|
|
6
|
+
<false/>
|
|
7
|
+
<key>NSPrivacyTrackingDomains</key>
|
|
8
|
+
<array/>
|
|
9
|
+
<key>NSPrivacyCollectedDataTypes</key>
|
|
10
|
+
<array/>
|
|
11
|
+
<key>NSPrivacyAccessedAPITypes</key>
|
|
12
|
+
<array>
|
|
13
|
+
<dict>
|
|
14
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
15
|
+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
16
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
17
|
+
<array>
|
|
18
|
+
<string>CA92.1</string>
|
|
19
|
+
</array>
|
|
20
|
+
</dict>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
23
|
+
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
24
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
25
|
+
<array>
|
|
26
|
+
<string>C617.1</string>
|
|
27
|
+
<string>3B52.1</string>
|
|
28
|
+
</array>
|
|
29
|
+
</dict>
|
|
30
|
+
</array>
|
|
31
|
+
</dict>
|
|
32
|
+
</plist>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Comnyx iOS post-install helpers.
|
|
2
|
+
#
|
|
3
|
+
# Usage in a host app's Podfile:
|
|
4
|
+
#
|
|
5
|
+
# require_relative '../node_modules/@developer_tribe/react-native-comnyx/ios/comnyx_post_install'
|
|
6
|
+
#
|
|
7
|
+
# post_install do |installer|
|
|
8
|
+
# comnyx_post_install(installer)
|
|
9
|
+
# react_native_post_install(installer, config[:reactNativePath], :mac_catalyst_enabled => false)
|
|
10
|
+
# end
|
|
11
|
+
#
|
|
12
|
+
# What this does:
|
|
13
|
+
# React Native 0.85 ships React-Core as a prebuilt XCFramework whose umbrella
|
|
14
|
+
# header re-imports non-modular React-Core headers. Xcode 26 Clang explicit
|
|
15
|
+
# modules rejects that, failing the pod build. Enabling
|
|
16
|
+
# CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES on every pod target
|
|
17
|
+
# lets the umbrella compile. Safe on older RN versions (no-op there).
|
|
18
|
+
|
|
19
|
+
def comnyx_post_install(installer)
|
|
20
|
+
installer.pods_project.targets.each do |target|
|
|
21
|
+
target.build_configurations.each do |config|
|
|
22
|
+
config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
+
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
+
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
+
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
+
#else
|
|
16
|
+
#import "RCTDependencyProvider.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
+
|
|
21
|
+
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTAppDependencyProvider.h"
|
|
9
|
+
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
+
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
+
|
|
12
|
+
@implementation RCTAppDependencyProvider {
|
|
13
|
+
NSArray<NSString *> * _URLRequestHandlerClassNames;
|
|
14
|
+
NSArray<NSString *> * _imageDataDecoderClassNames;
|
|
15
|
+
NSArray<NSString *> * _imageURLLoaderClassNames;
|
|
16
|
+
NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
20
|
+
static dispatch_once_t requestUrlToken;
|
|
21
|
+
dispatch_once(&requestUrlToken, ^{
|
|
22
|
+
self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return _URLRequestHandlerClassNames;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
29
|
+
static dispatch_once_t dataDecoderToken;
|
|
30
|
+
dispatch_once(&dataDecoderToken, ^{
|
|
31
|
+
_imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return _imageDataDecoderClassNames;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
38
|
+
static dispatch_once_t urlLoaderToken;
|
|
39
|
+
dispatch_once(&urlLoaderToken, ^{
|
|
40
|
+
_imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _imageURLLoaderClassNames;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
47
|
+
static dispatch_once_t nativeComponentsToken;
|
|
48
|
+
dispatch_once(&nativeComponentsToken, ^{
|
|
49
|
+
_thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return _thirdPartyFabricComponents;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
+
|
|
14
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
+
|
|
16
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
+
|
|
10
|
+
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
+
{
|
|
14
|
+
return @[
|
|
15
|
+
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
20
|
+
{
|
|
21
|
+
return @[
|
|
22
|
+
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
27
|
+
{
|
|
28
|
+
return @[
|
|
29
|
+
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@protocol RCTComponentViewProtocol;
|
|
11
|
+
|
|
12
|
+
@interface RCTThirdPartyComponentsProvider: NSObject
|
|
13
|
+
|
|
14
|
+
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#import "RCTThirdPartyComponentsProvider.h"
|
|
12
|
+
#import <React/RCTComponentViewProtocol.h>
|
|
13
|
+
|
|
14
|
+
@implementation RCTThirdPartyComponentsProvider
|
|
15
|
+
|
|
16
|
+
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
|
17
|
+
{
|
|
18
|
+
return @{
|
|
19
|
+
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "RNComnyxSpec.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@implementation NativeComnyxSpecBase
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
21
|
+
{
|
|
22
|
+
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
23
|
+
}
|
|
24
|
+
@end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
namespace facebook::react {
|
|
28
|
+
|
|
29
|
+
static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
30
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "initialize", @selector(initialize:reject:), args, count);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_checkOptIn(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
34
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "checkOptIn", @selector(checkOptIn:reject:), args, count);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_optIn(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
38
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "optIn", @selector(optIn:reject:), args, count);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
NativeComnyxSpecJSI::NativeComnyxSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
42
|
+
: ObjCTurboModule(params) {
|
|
43
|
+
|
|
44
|
+
methodMap_["initialize"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_initialize};
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
methodMap_["checkOptIn"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_checkOptIn};
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
methodMap_["optIn"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_optIn};
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of RNComnyxSpec symbols
|
|
19
|
+
#ifndef RNComnyxSpec_H
|
|
20
|
+
#define RNComnyxSpec_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
+
|
|
36
|
+
@protocol NativeComnyxSpec <RCTBridgeModule, RCTTurboModule>
|
|
37
|
+
|
|
38
|
+
- (void)initialize:(RCTPromiseResolveBlock)resolve
|
|
39
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
40
|
+
- (void)checkOptIn:(RCTPromiseResolveBlock)resolve
|
|
41
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
42
|
+
- (void)optIn:(RCTPromiseResolveBlock)resolve
|
|
43
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
44
|
+
|
|
45
|
+
@end
|
|
46
|
+
|
|
47
|
+
@interface NativeComnyxSpecBase : NSObject {
|
|
48
|
+
@protected
|
|
49
|
+
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
50
|
+
}
|
|
51
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
namespace facebook::react {
|
|
57
|
+
/**
|
|
58
|
+
* ObjC++ class for module 'NativeComnyx'
|
|
59
|
+
*/
|
|
60
|
+
class JSI_EXPORT NativeComnyxSpecJSI : public ObjCTurboModule {
|
|
61
|
+
public:
|
|
62
|
+
NativeComnyxSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
63
|
+
};
|
|
64
|
+
} // namespace facebook::react
|
|
65
|
+
|
|
66
|
+
NS_ASSUME_NONNULL_END
|
|
67
|
+
#endif // RNComnyxSpec_H
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNComnyxSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->initialize(
|
|
16
|
+
rt
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_checkOptIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->checkOptIn(
|
|
21
|
+
rt
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_optIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
25
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->optIn(
|
|
26
|
+
rt
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
NativeComnyxCxxSpecJSI::NativeComnyxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
31
|
+
: TurboModule("Comnyx", jsInvoker) {
|
|
32
|
+
methodMap_["initialize"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_initialize};
|
|
33
|
+
methodMap_["checkOptIn"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_checkOptIn};
|
|
34
|
+
methodMap_["optIn"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_optIn};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
} // namespace facebook::react
|