@developer_tribe/react-native-comnyx 0.14.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 +105 -19
- 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.m +6 -0
- package/ios/ComnyxMediaPicker.swift +106 -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 +46 -6
- 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/assets/gallery.png +0 -0
- package/lib/commonjs/assets/video-play.png +0 -0
- 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/MediaPickerButton.js +211 -14
- package/lib/commonjs/components/MediaPickerButton.js.map +1 -1
- package/lib/commonjs/components/MediaViewerModal.js +7 -0
- package/lib/commonjs/components/MediaViewerModal.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 -2
- package/lib/commonjs/components/MessageItem.js.map +1 -1
- package/lib/commonjs/constants/translations.js +87 -116
- package/lib/commonjs/constants/translations.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 +43 -6
- 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/assets/gallery.png +0 -0
- package/lib/module/assets/video-play.png +0 -0
- 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/MediaPickerButton.js +215 -18
- package/lib/module/components/MediaPickerButton.js.map +1 -1
- package/lib/module/components/MediaViewerModal.js +8 -1
- package/lib/module/components/MediaViewerModal.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 -2
- package/lib/module/components/MessageItem.js.map +1 -1
- package/lib/module/constants/translations.js +87 -116
- package/lib/module/constants/translations.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 +11 -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/MediaPickerButton.d.ts.map +1 -1
- package/lib/typescript/src/components/MediaViewerModal.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/constants/translations.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/LocalizationKeys.d.ts +0 -1
- package/lib/typescript/src/types/LocalizationKeys.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 +46 -7
- 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/assets/gallery.png +0 -0
- package/src/assets/video-play.png +0 -0
- 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/MediaPickerButton.tsx +238 -17
- package/src/components/MediaViewerModal.tsx +8 -1
- package/src/components/MessageInput.tsx +89 -16
- package/src/components/MessageItem.tsx +12 -14
- package/src/constants/translations.ts +87 -116
- 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/LocalizationKeys.ts +0 -1
- 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,
|
package/ios/ComnyxMediaPicker.m
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
RCT_EXTERN_METHOD(pickMedia:(RCTPromiseResolveBlock)resolve
|
|
6
6
|
reject:(RCTPromiseRejectBlock)reject)
|
|
7
7
|
|
|
8
|
+
RCT_EXTERN_METHOD(pickImage:(RCTPromiseResolveBlock)resolve
|
|
9
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
10
|
+
|
|
11
|
+
RCT_EXTERN_METHOD(pickVideo:(RCTPromiseResolveBlock)resolve
|
|
12
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
13
|
+
|
|
8
14
|
RCT_EXTERN_METHOD(generateThumbnail:(NSString *)videoUrl
|
|
9
15
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
10
16
|
reject:(RCTPromiseRejectBlock)reject)
|
|
@@ -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
|
|
|
@@ -19,6 +26,12 @@ class ComnyxMediaPicker: NSObject, RCTBridgeModule {
|
|
|
19
26
|
private var resolveBlock: RCTPromiseResolveBlock?
|
|
20
27
|
private var rejectBlock: RCTPromiseRejectBlock?
|
|
21
28
|
|
|
29
|
+
private func rejectPendingPromise() {
|
|
30
|
+
rejectBlock?("CANCELLED", "A new picker request was made before the previous one completed", nil)
|
|
31
|
+
resolveBlock = nil
|
|
32
|
+
rejectBlock = nil
|
|
33
|
+
}
|
|
34
|
+
|
|
22
35
|
private func getRootViewController() -> UIViewController? {
|
|
23
36
|
return UIApplication.shared.delegate?.window??.rootViewController?.presentedViewController
|
|
24
37
|
?? UIApplication.shared.delegate?.window??.rootViewController
|
|
@@ -29,6 +42,7 @@ class ComnyxMediaPicker: NSObject, RCTBridgeModule {
|
|
|
29
42
|
|
|
30
43
|
@objc
|
|
31
44
|
func pickMedia(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
45
|
+
rejectPendingPromise()
|
|
32
46
|
self.resolveBlock = resolve
|
|
33
47
|
self.rejectBlock = reject
|
|
34
48
|
|
|
@@ -50,6 +64,58 @@ class ComnyxMediaPicker: NSObject, RCTBridgeModule {
|
|
|
50
64
|
}
|
|
51
65
|
}
|
|
52
66
|
|
|
67
|
+
// MARK: - Pick Image Only
|
|
68
|
+
|
|
69
|
+
@objc
|
|
70
|
+
func pickImage(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
71
|
+
rejectPendingPromise()
|
|
72
|
+
self.resolveBlock = resolve
|
|
73
|
+
self.rejectBlock = reject
|
|
74
|
+
|
|
75
|
+
DispatchQueue.main.async {
|
|
76
|
+
if #available(iOS 14.0, *) {
|
|
77
|
+
var config = PHPickerConfiguration()
|
|
78
|
+
config.filter = .images
|
|
79
|
+
config.selectionLimit = 0
|
|
80
|
+
let picker = PHPickerViewController(configuration: config)
|
|
81
|
+
picker.delegate = self
|
|
82
|
+
self.getRootViewController()?.present(picker, animated: true)
|
|
83
|
+
} else {
|
|
84
|
+
let picker = UIImagePickerController()
|
|
85
|
+
picker.sourceType = .photoLibrary
|
|
86
|
+
picker.mediaTypes = ["public.image"]
|
|
87
|
+
picker.delegate = self
|
|
88
|
+
self.getRootViewController()?.present(picker, animated: true)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// MARK: - Pick Video Only
|
|
94
|
+
|
|
95
|
+
@objc
|
|
96
|
+
func pickVideo(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
97
|
+
rejectPendingPromise()
|
|
98
|
+
self.resolveBlock = resolve
|
|
99
|
+
self.rejectBlock = reject
|
|
100
|
+
|
|
101
|
+
DispatchQueue.main.async {
|
|
102
|
+
if #available(iOS 14.0, *) {
|
|
103
|
+
var config = PHPickerConfiguration()
|
|
104
|
+
config.filter = .videos
|
|
105
|
+
config.selectionLimit = 0
|
|
106
|
+
let picker = PHPickerViewController(configuration: config)
|
|
107
|
+
picker.delegate = self
|
|
108
|
+
self.getRootViewController()?.present(picker, animated: true)
|
|
109
|
+
} else {
|
|
110
|
+
let picker = UIImagePickerController()
|
|
111
|
+
picker.sourceType = .photoLibrary
|
|
112
|
+
picker.mediaTypes = ["public.movie"]
|
|
113
|
+
picker.delegate = self
|
|
114
|
+
self.getRootViewController()?.present(picker, animated: true)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
53
119
|
// MARK: - Generate Thumbnail from Video URL
|
|
54
120
|
|
|
55
121
|
@objc
|
|
@@ -244,7 +310,7 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
244
310
|
provider.loadFileRepresentation(forTypeIdentifier: "public.image") { [weak self] url, error in
|
|
245
311
|
defer { group.leave() }
|
|
246
312
|
guard let self = self, let sourceURL = url, error == nil else {
|
|
247
|
-
|
|
313
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image load failed: \(error?.localizedDescription ?? "no url")")
|
|
248
314
|
return
|
|
249
315
|
}
|
|
250
316
|
|
|
@@ -264,12 +330,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
264
330
|
"fileSize": finalData.count,
|
|
265
331
|
"mimeType": finalMimeType,
|
|
266
332
|
]
|
|
267
|
-
|
|
333
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image asset ready: \(asset)")
|
|
268
334
|
lock.lock()
|
|
269
335
|
allAssets.add(asset)
|
|
270
336
|
lock.unlock()
|
|
271
337
|
} catch {
|
|
272
|
-
|
|
338
|
+
comnyxMediaLog("[ComnyxMediaPicker] Image processing error: \(error)")
|
|
273
339
|
}
|
|
274
340
|
}
|
|
275
341
|
continue
|
|
@@ -281,7 +347,7 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
281
347
|
provider.loadFileRepresentation(forTypeIdentifier: "public.movie") { [weak self] url, error in
|
|
282
348
|
defer { group.leave() }
|
|
283
349
|
guard let self = self, let sourceURL = url, error == nil else {
|
|
284
|
-
|
|
350
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video load failed: \(error?.localizedDescription ?? "no url")")
|
|
285
351
|
return
|
|
286
352
|
}
|
|
287
353
|
|
|
@@ -306,12 +372,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
306
372
|
if let thumb = thumbnailUri {
|
|
307
373
|
asset["thumbnailUri"] = thumb
|
|
308
374
|
}
|
|
309
|
-
|
|
375
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video asset ready: \(asset)")
|
|
310
376
|
lock.lock()
|
|
311
377
|
allAssets.add(asset)
|
|
312
378
|
lock.unlock()
|
|
313
379
|
} catch {
|
|
314
|
-
|
|
380
|
+
comnyxMediaLog("[ComnyxMediaPicker] Video processing error: \(error)")
|
|
315
381
|
}
|
|
316
382
|
}
|
|
317
383
|
continue
|
|
@@ -319,12 +385,12 @@ extension ComnyxMediaPicker: PHPickerViewControllerDelegate {
|
|
|
319
385
|
}
|
|
320
386
|
|
|
321
387
|
group.notify(queue: .main) { [weak self] in
|
|
322
|
-
|
|
388
|
+
comnyxMediaLog("[ComnyxMediaPicker] All assets processed. Count: \(allAssets.count)")
|
|
323
389
|
if allAssets.count == 0 {
|
|
324
390
|
self?.resolveBlock?(nil)
|
|
325
391
|
} else {
|
|
326
392
|
let result = allAssets.map { $0 }
|
|
327
|
-
|
|
393
|
+
comnyxMediaLog("[ComnyxMediaPicker] Resolving with \(result.count) assets")
|
|
328
394
|
self?.resolveBlock?(result)
|
|
329
395
|
}
|
|
330
396
|
self?.resolveBlock = nil
|
|
@@ -340,26 +406,40 @@ extension ComnyxMediaPicker: UIImagePickerControllerDelegate, UINavigationContro
|
|
|
340
406
|
picker.dismiss(animated: true)
|
|
341
407
|
|
|
342
408
|
if let imageURL = info[.imageURL] as? URL {
|
|
343
|
-
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
+
}
|
|
351
424
|
}
|
|
352
425
|
} else if let videoURL = info[.mediaURL] as? URL {
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
+
}
|
|
363
443
|
}
|
|
364
444
|
} else {
|
|
365
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
|