@developer_tribe/react-native-comnyx 0.12.14 → 0.13.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/Comnyx.podspec +23 -10
- package/android/build.gradle +60 -4
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +46 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +44 -0
- package/android/generated/jni/RNComnyxSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +38 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +89 -0
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +15 -16
- package/ios/Comnyx.h +17 -0
- package/ios/Comnyx.m +7 -5
- package/ios/Comnyx.swift +11 -10
- package/ios/ComnyxObjC.h +19 -0
- package/ios/ComnyxObjC.m +28 -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/NativeComnyx.js +5 -2
- package/lib/commonjs/NativeComnyx.js.map +1 -1
- package/lib/commonjs/components/ChatList.js +53 -125
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/constants/translations.js +58 -0
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/hooks/usePolling.js.map +1 -1
- package/lib/commonjs/register/Accumulator.js.map +1 -1
- package/lib/commonjs/store/store.js +2 -3
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/commonjs/utils/formatDate.js +30 -9
- package/lib/commonjs/utils/formatDate.js.map +1 -1
- package/lib/commonjs/utils/mmkvStorage.js +21 -0
- package/lib/commonjs/utils/mmkvStorage.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/NativeComnyx.js +8 -2
- package/lib/module/NativeComnyx.js.map +1 -1
- package/lib/module/components/ChatList.js +54 -126
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/constants/translations.js +58 -0
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/hooks/usePolling.js.map +1 -1
- package/lib/module/register/Accumulator.js.map +1 -1
- package/lib/module/store/store.js +2 -2
- package/lib/module/store/store.js.map +1 -1
- package/lib/module/utils/formatDate.js +28 -8
- package/lib/module/utils/formatDate.js.map +1 -1
- package/lib/module/utils/mmkvStorage.js +17 -0
- package/lib/module/utils/mmkvStorage.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/NativeComnyx.d.ts +21 -8
- package/lib/typescript/src/NativeComnyx.d.ts.map +1 -1
- package/lib/typescript/src/api/conversations.d.ts +1 -1
- package/lib/typescript/src/api/conversations.d.ts.map +1 -1
- package/lib/typescript/src/components/AppText.d.ts +1 -1
- package/lib/typescript/src/components/AppText.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts +1 -1
- package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts.map +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +2 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/lib/typescript/src/utils/formatDate.d.ts +1 -0
- package/lib/typescript/src/utils/formatDate.d.ts.map +1 -1
- package/lib/typescript/src/utils/mmkvStorage.d.ts +3 -0
- package/lib/typescript/src/utils/mmkvStorage.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/lib/typescript/src/version.d.ts.map +1 -1
- package/package.json +21 -12
- package/src/NativeComnyx.ts +30 -10
- package/src/components/ChatList.tsx +101 -174
- package/src/constants/translations.ts +58 -0
- package/src/hooks/usePolling.ts +1 -1
- package/src/register/Accumulator.ts +1 -1
- package/src/store/store.ts +2 -2
- package/src/types/LocalizationKeys.ts +2 -0
- package/src/utils/formatDate.ts +46 -9
- package/src/utils/mmkvStorage.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/typescript/jest.config.d.ts +0 -4
- package/lib/typescript/jest.config.d.ts.map +0 -1
|
@@ -31,7 +31,7 @@ import android.content.ClipboardManager
|
|
|
31
31
|
//TODO: logging (from bridge)
|
|
32
32
|
@ReactModule(name = ComnyxModule.NAME)
|
|
33
33
|
class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
34
|
-
|
|
34
|
+
NativeComnyxSpec(reactContext), PermissionListener {
|
|
35
35
|
private val comnyxMessaging : ComnyxMessaging
|
|
36
36
|
private var pendingPromise: Promise? = null
|
|
37
37
|
private val PERMISSION_REQUEST_CODE = 100
|
|
@@ -42,10 +42,6 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
42
42
|
__self = this
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
override fun getName(): String {
|
|
46
|
-
return NAME
|
|
47
|
-
}
|
|
48
|
-
|
|
49
45
|
private fun sendEvent(reactContext: ReactContext, eventName: String, params: Any?) {
|
|
50
46
|
Logger.v("sendEvent($eventName) params=${params != null}", NAME)
|
|
51
47
|
reactContext
|
|
@@ -54,15 +50,17 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
@ReactMethod
|
|
57
|
-
fun addListener(eventName: String
|
|
53
|
+
override fun addListener(eventName: String) {
|
|
54
|
+
// Required for RCTEventEmitter compatibility
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
@ReactMethod
|
|
61
|
-
fun removeListeners(count:
|
|
58
|
+
override fun removeListeners(count: Double) {
|
|
59
|
+
// Required for RCTEventEmitter compatibility
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
fun initialize(options: ReadableMap?, promise: Promise) {
|
|
62
|
+
// Spec-compliant method with options parameter
|
|
63
|
+
override fun initialize(options: ReadableMap?, promise: Promise) {
|
|
66
64
|
Logger.v("initialize called", NAME)
|
|
67
65
|
try {
|
|
68
66
|
if (options != null && options.hasKey("logLevel") && !options.isNull("logLevel")) {
|
|
@@ -99,8 +97,7 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
99
97
|
)
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
fun checkOptIn(promise: Promise) {
|
|
100
|
+
override fun checkOptIn(promise: Promise) {
|
|
104
101
|
Logger.v("checkOptIn called", NAME)
|
|
105
102
|
try {
|
|
106
103
|
// Check system notification settings
|
|
@@ -139,8 +136,7 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
139
136
|
}
|
|
140
137
|
}
|
|
141
138
|
|
|
142
|
-
|
|
143
|
-
fun optIn(promise: Promise) {
|
|
139
|
+
override fun optIn(promise: Promise) {
|
|
144
140
|
Logger.v("optIn called", NAME)
|
|
145
141
|
try {
|
|
146
142
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
@@ -211,7 +207,8 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
211
207
|
}
|
|
212
208
|
|
|
213
209
|
@ReactMethod
|
|
214
|
-
fun copyToClipboard(text: String, promise: Promise) {
|
|
210
|
+
override fun copyToClipboard(text: String, promise: Promise) {
|
|
211
|
+
Logger.v("copyToClipboard called", NAME)
|
|
215
212
|
val clipboardManager = reactApplicationContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
|
216
213
|
val clip = ClipData.newPlainText("text", text)
|
|
217
214
|
clipboardManager.setPrimaryClip(clip)
|
|
@@ -219,7 +216,8 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
219
216
|
}
|
|
220
217
|
|
|
221
218
|
@ReactMethod
|
|
222
|
-
fun linkToSettings(promise: Promise) {
|
|
219
|
+
override fun linkToSettings(promise: Promise) {
|
|
220
|
+
Logger.v("linkToSettings called", NAME)
|
|
223
221
|
try {
|
|
224
222
|
val intent = Intent()
|
|
225
223
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
@@ -242,7 +240,8 @@ class ComnyxModule(reactContext: ReactApplicationContext) :
|
|
|
242
240
|
}
|
|
243
241
|
|
|
244
242
|
companion object {
|
|
245
|
-
|
|
243
|
+
// NAME comes from NativeComnyxSpec
|
|
244
|
+
const val NAME = NativeComnyxSpec.NAME
|
|
246
245
|
var __self: ComnyxModule? = null
|
|
247
246
|
|
|
248
247
|
fun handleNewIntent(intent: android.content.Intent?) {
|
package/ios/Comnyx.h
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Comnyx.h
|
|
3
|
+
// Public umbrella header for Objective-C consumers
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#ifndef Comnyx_h
|
|
7
|
+
#define Comnyx_h
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
// Objective-C umbrella header for consumers.
|
|
12
|
+
// Do NOT import the generated Swift header here; it may not exist yet
|
|
13
|
+
// when CocoaPods exposes public headers (e.g., with static linkage).
|
|
14
|
+
// Instead, expose the Objective-C convenience API.
|
|
15
|
+
#import <Comnyx/ComnyxObjC.h>
|
|
16
|
+
|
|
17
|
+
#endif /* Comnyx_h */
|
package/ios/Comnyx.m
CHANGED
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
@interface RCT_EXTERN_MODULE(Comnyx, RCTEventEmitter)
|
|
5
5
|
|
|
6
|
-
RCT_EXTERN_METHOD(
|
|
6
|
+
RCT_EXTERN_METHOD(initialize:(NSDictionary *)options
|
|
7
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
7
8
|
reject:(RCTPromiseRejectBlock)reject)
|
|
8
9
|
|
|
9
|
-
RCT_EXTERN_METHOD(
|
|
10
|
+
RCT_EXTERN_METHOD(checkOptIn:(RCTPromiseResolveBlock)resolve
|
|
10
11
|
reject:(RCTPromiseRejectBlock)reject)
|
|
11
12
|
|
|
12
|
-
RCT_EXTERN_METHOD(
|
|
13
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
13
|
+
RCT_EXTERN_METHOD(optIn:(RCTPromiseResolveBlock)resolve
|
|
14
14
|
reject:(RCTPromiseRejectBlock)reject)
|
|
15
15
|
|
|
16
16
|
RCT_EXTERN_METHOD(linkToSettings:(RCTPromiseResolveBlock)resolve
|
|
17
17
|
reject:(RCTPromiseRejectBlock)reject)
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
RCT_EXTERN_METHOD(copyToClipboard:(NSString *)text
|
|
19
20
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
20
21
|
reject:(RCTPromiseRejectBlock)reject)
|
|
22
|
+
|
|
21
23
|
@end
|
package/ios/Comnyx.swift
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
+
import UIKit
|
|
9
10
|
import UserNotifications
|
|
11
|
+
import React
|
|
10
12
|
|
|
11
13
|
//TODO: logging (from bridge)
|
|
12
14
|
@objc(Comnyx)
|
|
13
|
-
class Comnyx: RCTEventEmitter {
|
|
15
|
+
public class Comnyx: RCTEventEmitter {
|
|
14
16
|
private var hasListeners: Bool = false
|
|
15
17
|
var comnyxMessaging: ComnyxMessaging?
|
|
16
18
|
|
|
@@ -73,20 +75,20 @@ class Comnyx: RCTEventEmitter {
|
|
|
73
75
|
deinit {
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
override static func requiresMainQueueSetup() -> Bool {
|
|
78
|
+
override public static func requiresMainQueueSetup() -> Bool {
|
|
77
79
|
return true
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
override func supportedEvents() -> [String] {
|
|
82
|
+
override public func supportedEvents() -> [String] {
|
|
81
83
|
return ["TOKEN_INIT", "TOKEN_FAILED", "NOTIFICATION_RECEIVED", "NOTIFICATION_CLICKED"]
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
override func startObserving() {
|
|
86
|
+
override public func startObserving() {
|
|
85
87
|
hasListeners = true
|
|
86
88
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
override func stopObserving() {
|
|
91
|
+
override public func stopObserving() {
|
|
90
92
|
hasListeners = false
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -133,7 +135,7 @@ class Comnyx: RCTEventEmitter {
|
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
@objc
|
|
136
|
-
func initialize(_ options: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject
|
|
138
|
+
func initialize(_ options: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
137
139
|
let logLevel = options["logLevel"] as? String ?? "warn"
|
|
138
140
|
NSLog("Comnyx Log Level: \(logLevel) passed from JavaScript. It will be supported in the future.")
|
|
139
141
|
|
|
@@ -166,7 +168,7 @@ class Comnyx: RCTEventEmitter {
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
@objc
|
|
169
|
-
func linkToSettings(_ resolve: @escaping RCTPromiseResolveBlock, reject
|
|
171
|
+
func linkToSettings(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
170
172
|
if let settingsUrl = URL(string: UIApplication.openSettingsURLString) {
|
|
171
173
|
if UIApplication.shared.canOpenURL(settingsUrl) {
|
|
172
174
|
UIApplication.shared.open(settingsUrl, completionHandler: { success in
|
|
@@ -191,7 +193,7 @@ class Comnyx: RCTEventEmitter {
|
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
@objc
|
|
194
|
-
static func registerDeviceToken(_ deviceToken: Data) {
|
|
196
|
+
public static func registerDeviceToken(_ deviceToken: Data) {
|
|
195
197
|
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
|
|
196
198
|
print("Device Token: \(token)")
|
|
197
199
|
|
|
@@ -204,7 +206,7 @@ class Comnyx: RCTEventEmitter {
|
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
@objc
|
|
207
|
-
static func registerDeviceTokenFailed(_ error: Error) {
|
|
209
|
+
public static func registerDeviceTokenFailed(_ error: Error) {
|
|
208
210
|
print("Device Token Failed: \(error)")
|
|
209
211
|
// Post notification for RCT modules to handle
|
|
210
212
|
NotificationCenter.default.post(
|
|
@@ -213,5 +215,4 @@ class Comnyx: RCTEventEmitter {
|
|
|
213
215
|
userInfo: ["error": error]
|
|
214
216
|
)
|
|
215
217
|
}
|
|
216
|
-
|
|
217
218
|
}
|
package/ios/ComnyxObjC.h
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ComnyxObjC.h
|
|
3
|
+
// Objective-C convenience wrapper for Comnyx Swift APIs
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import <Foundation/Foundation.h>
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface ComnyxObjC : NSObject
|
|
11
|
+
|
|
12
|
+
+ (void)registerDeviceToken:(NSData *)deviceToken;
|
|
13
|
+
|
|
14
|
+
+ (void)registerDeviceTokenFailed:(NSError *)error;
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
19
|
+
|
package/ios/ComnyxObjC.m
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ComnyxObjC.m
|
|
3
|
+
// Objective-C convenience wrapper for Comnyx Swift APIs
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import "ComnyxObjC.h"
|
|
7
|
+
|
|
8
|
+
// Import the generated Swift header conditionally to support
|
|
9
|
+
// both framework and static library integrations.
|
|
10
|
+
#if __has_include(<Comnyx/Comnyx-Swift.h>)
|
|
11
|
+
#import <Comnyx/Comnyx-Swift.h>
|
|
12
|
+
#elif __has_include("Comnyx-Swift.h")
|
|
13
|
+
#import "Comnyx-Swift.h"
|
|
14
|
+
#else
|
|
15
|
+
#warning "Comnyx-Swift.h not found. Ensure the Swift part of the Comnyx pod is compiled."
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
@implementation ComnyxObjC
|
|
19
|
+
|
|
20
|
+
+ (void)registerDeviceToken:(NSData *)deviceToken {
|
|
21
|
+
[Comnyx registerDeviceToken:deviceToken];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
+ (void)registerDeviceTokenFailed:(NSError *)error {
|
|
25
|
+
[Comnyx registerDeviceTokenFailed:error];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@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
|