@developer_tribe/react-native-comnyx 0.12.13 → 0.12.15
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/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/lib/commonjs/NativeComnyx.js +5 -2
- package/lib/commonjs/NativeComnyx.js.map +1 -1
- package/lib/commonjs/register/login.js +6 -2
- package/lib/commonjs/register/login.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/NativeComnyx.js +8 -2
- package/lib/module/NativeComnyx.js.map +1 -1
- package/lib/module/register/login.js +6 -2
- package/lib/module/register/login.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/jest.config.d.ts.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/register/login.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/NativeComnyx.ts +30 -10
- package/src/register/login.ts +9 -2
- package/src/version.ts +1 -1
- package/android/generated/RCTAppDependencyProvider.h +0 -25
- package/android/generated/RCTAppDependencyProvider.mm +0 -55
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/android/generated/RCTThirdPartyComponentsProvider.h +0 -16
- package/android/generated/RCTThirdPartyComponentsProvider.mm +0 -23
- package/android/generated/ReactAppDependencyProvider.podspec +0 -34
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNComnyxSpec-generated.cpp +0 -22
- package/android/generated/jni/RNComnyxSpec.h +0 -24
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -17
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -19
package/Comnyx.podspec
CHANGED
|
@@ -9,18 +9,31 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.homepage = package["homepage"]
|
|
10
10
|
s.license = package["license"]
|
|
11
11
|
s.authors = package["author"]
|
|
12
|
+
s.swift_version = "5.9"
|
|
12
13
|
|
|
13
14
|
s.platforms = { :ios => min_ios_version_supported }
|
|
14
15
|
s.source = { :git => "https://www.npmjs.com.git", :tag => "#{s.version}" }
|
|
15
16
|
|
|
16
|
-
s.source_files = "ios/**/*.{h,m,mm,cpp,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
18
|
+
|
|
19
|
+
# Exclude generated files to avoid duplicate definitions
|
|
20
|
+
s.exclude_files = "ios/generated/**/*"
|
|
21
|
+
|
|
22
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
23
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
24
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
25
|
+
install_modules_dependencies(s)
|
|
26
|
+
else
|
|
27
|
+
s.dependency "React-Core"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Swift settings for better compatibility
|
|
31
|
+
s.pod_target_xcconfig = {
|
|
32
|
+
'DEFINES_MODULE' => 'NO',
|
|
33
|
+
'SWIFT_COMPILATION_MODE' => 'singlefile'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
s.user_target_xcconfig = {
|
|
37
|
+
'DEFINES_MODULE' => 'NO'
|
|
38
|
+
}
|
|
26
39
|
end
|
package/android/build.gradle
CHANGED
|
@@ -65,15 +65,18 @@ android {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
compileOptions {
|
|
68
|
-
sourceCompatibility JavaVersion.
|
|
69
|
-
targetCompatibility JavaVersion.
|
|
68
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
69
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
kotlinOptions {
|
|
73
|
+
jvmTarget = '17'
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
sourceSets {
|
|
73
77
|
main {
|
|
74
78
|
java.srcDirs += [
|
|
75
|
-
"generated/java"
|
|
76
|
-
"generated/jni"
|
|
79
|
+
"build/generated/source/codegen/java"
|
|
77
80
|
]
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -102,4 +105,57 @@ dependencies {
|
|
|
102
105
|
react {
|
|
103
106
|
jsRootDir = file("../src/")
|
|
104
107
|
libraryName = "Comnyx"
|
|
108
|
+
codegenJavaPackageName = "com.comnyx"
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Ensure Kotlin compilation happens after codegen
|
|
112
|
+
afterEvaluate {
|
|
113
|
+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
114
|
+
dependsOn("generateCodegenArtifactsFromSchema")
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// For Old Architecture compatibility: Create a stub NativeComnyxSpec if it doesn't exist
|
|
119
|
+
task createOldArchStub {
|
|
120
|
+
doLast {
|
|
121
|
+
def newArchEnabled = project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
122
|
+
def stubFile = file("build/generated/source/codegen/java/com/comnyx/NativeComnyxSpec.java")
|
|
123
|
+
|
|
124
|
+
if (!newArchEnabled && !stubFile.exists()) {
|
|
125
|
+
stubFile.parentFile.mkdirs()
|
|
126
|
+
stubFile.text = """
|
|
127
|
+
package com.comnyx;
|
|
128
|
+
|
|
129
|
+
import com.facebook.react.bridge.Promise;
|
|
130
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
131
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
132
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
133
|
+
|
|
134
|
+
public abstract class NativeComnyxSpec extends ReactContextBaseJavaModule {
|
|
135
|
+
public static final String NAME = "Comnyx";
|
|
136
|
+
|
|
137
|
+
public NativeComnyxSpec(ReactApplicationContext reactContext) {
|
|
138
|
+
super(reactContext);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@Override
|
|
142
|
+
public String getName() {
|
|
143
|
+
return NAME;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public abstract void initialize(ReadableMap options, Promise promise);
|
|
147
|
+
public abstract void checkOptIn(Promise promise);
|
|
148
|
+
public abstract void optIn(Promise promise);
|
|
149
|
+
public abstract void linkToSettings(Promise promise);
|
|
150
|
+
public abstract void copyToClipboard(String text, Promise promise);
|
|
151
|
+
public abstract void addListener(String eventName);
|
|
152
|
+
public abstract void removeListeners(double count);
|
|
153
|
+
}
|
|
154
|
+
"""
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
160
|
+
dependsOn("createOldArchStub")
|
|
105
161
|
}
|
|
@@ -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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.nativeComnyx = exports.NotificationPermissionStatus = void 0;
|
|
6
|
+
exports.nativeComnyx = exports.default = exports.NotificationPermissionStatus = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
let NotificationPermissionStatus = exports.NotificationPermissionStatus = /*#__PURE__*/function (NotificationPermissionStatus) {
|
|
9
9
|
NotificationPermissionStatus["GRANTED"] = "granted";
|
|
@@ -11,5 +11,8 @@ let NotificationPermissionStatus = exports.NotificationPermissionStatus = /*#__P
|
|
|
11
11
|
NotificationPermissionStatus["BLOCKED"] = "blocked";
|
|
12
12
|
return NotificationPermissionStatus;
|
|
13
13
|
}({});
|
|
14
|
-
|
|
14
|
+
// Single TurboModule registry call for Codegen
|
|
15
|
+
const NativeComnyxModule = _reactNative.TurboModuleRegistry.get('Comnyx');
|
|
16
|
+
var _default = exports.default = NativeComnyxModule; // Legacy export for backward compatibility
|
|
17
|
+
const nativeComnyx = exports.nativeComnyx = NativeComnyxModule;
|
|
15
18
|
//# sourceMappingURL=NativeComnyx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","NotificationPermissionStatus","exports","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NotificationPermissionStatus","exports","NativeComnyxModule","TurboModuleRegistry","get","_default","default","nativeComnyx"],"sourceRoot":"../../src","sources":["NativeComnyx.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAEvCC,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,0BAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA;AA2BxC;AACA,MAAME,kBAAkB,GAAGC,gCAAmB,CAACC,GAAG,CAAO,QAAQ,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAEpDJ,kBAAkB,EAEjC;AASO,MAAMK,YAAY,GAAAN,OAAA,CAAAM,YAAA,GAAGL,kBAA6C","ignoreList":[]}
|
|
@@ -19,8 +19,12 @@ function login(loginOptions) {
|
|
|
19
19
|
_Accumulator.accumulator.clear();
|
|
20
20
|
_store.useAppStore.getState().setRegistered(true);
|
|
21
21
|
_Accumulator.accumulator.register(async accumulatedData => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
try {
|
|
23
|
+
const data = await (0, _customers.updateCustomer)(accumulatedData, loginOptions.externalId);
|
|
24
|
+
_store.useAppStore.getState().setCustomer(data.customer);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('[Comnyx] Error in login', error);
|
|
27
|
+
}
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Accumulator","require","_api","_store","_customers","login","loginOptions","isInitCalled","Error","externalId","setLoginForAxios","accumulator","clear","useAppStore","getState","setRegistered","register","accumulatedData","data","updateCustomer","setCustomer","customer"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAMO,SAASI,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAAC,IAAAC,iBAAY,EAAC,CAAC,EAAE;IACnB,MAAM,IAAIC,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACF,YAAY,CAACG,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACA,IAAAE,qBAAgB,EAACJ,YAAY,CAACG,UAAU,CAAC;EACzCE,wBAAW,CAACC,KAAK,CAAC,CAAC;EACnBC,kBAAW,CAACC,QAAQ,CAAC,CAAC,CAACC,aAAa,CAAC,IAAI,CAAC;EAC1CJ,wBAAW,CAACK,QAAQ,CAAC,MAAOC,eAAsC,IAAK;IACrE,MAAMC,IAAI,GAAG,MAAM,IAAAC,yBAAc,
|
|
1
|
+
{"version":3,"names":["_Accumulator","require","_api","_store","_customers","login","loginOptions","isInitCalled","Error","externalId","setLoginForAxios","accumulator","clear","useAppStore","getState","setRegistered","register","accumulatedData","data","updateCustomer","setCustomer","customer","error","console"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAMO,SAASI,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAAC,IAAAC,iBAAY,EAAC,CAAC,EAAE;IACnB,MAAM,IAAIC,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACF,YAAY,CAACG,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACA,IAAAE,qBAAgB,EAACJ,YAAY,CAACG,UAAU,CAAC;EACzCE,wBAAW,CAACC,KAAK,CAAC,CAAC;EACnBC,kBAAW,CAACC,QAAQ,CAAC,CAAC,CAACC,aAAa,CAAC,IAAI,CAAC;EAC1CJ,wBAAW,CAACK,QAAQ,CAAC,MAAOC,eAAsC,IAAK;IACrE,IAAI;MACF,MAAMC,IAAI,GAAG,MAAM,IAAAC,yBAAc,EAC/BF,eAAe,EACfX,YAAY,CAACG,UACf,CAAC;MACDI,kBAAW,CAACC,QAAQ,CAAC,CAAC,CAACM,WAAW,CAACF,IAAI,CAACG,QAAQ,CAAC;IACnD,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,yBAAyB,EAAEA,KAAK,CAAC;IACjD;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
4
|
export let NotificationPermissionStatus = /*#__PURE__*/function (NotificationPermissionStatus) {
|
|
5
5
|
NotificationPermissionStatus["GRANTED"] = "granted";
|
|
6
6
|
NotificationPermissionStatus["DENIED"] = "denied";
|
|
7
7
|
NotificationPermissionStatus["BLOCKED"] = "blocked";
|
|
8
8
|
return NotificationPermissionStatus;
|
|
9
9
|
}({});
|
|
10
|
-
|
|
10
|
+
// Single TurboModule registry call for Codegen
|
|
11
|
+
const NativeComnyxModule = TurboModuleRegistry.get('Comnyx');
|
|
12
|
+
export default NativeComnyxModule;
|
|
13
|
+
|
|
14
|
+
// Legacy export for backward compatibility
|
|
15
|
+
|
|
16
|
+
export const nativeComnyx = NativeComnyxModule;
|
|
11
17
|
//# sourceMappingURL=NativeComnyx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","NotificationPermissionStatus","NativeComnyxModule","get","nativeComnyx"],"sourceRoot":"../../src","sources":["NativeComnyx.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAElD,WAAYC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA;AA2BxC;AACA,MAAMC,kBAAkB,GAAGF,mBAAmB,CAACG,GAAG,CAAO,QAAQ,CAAC;AAElE,eAAeD,kBAAkB;;AAEjC;;AASA,OAAO,MAAME,YAAY,GAAGF,kBAA6C","ignoreList":[]}
|
|
@@ -15,8 +15,12 @@ export function login(loginOptions) {
|
|
|
15
15
|
accumulator.clear();
|
|
16
16
|
useAppStore.getState().setRegistered(true);
|
|
17
17
|
accumulator.register(async accumulatedData => {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
try {
|
|
19
|
+
const data = await updateCustomer(accumulatedData, loginOptions.externalId);
|
|
20
|
+
useAppStore.getState().setCustomer(data.customer);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('[Comnyx] Error in login', error);
|
|
23
|
+
}
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accumulator","isInitCalled","setLoginForAxios","useAppStore","updateCustomer","login","loginOptions","Error","externalId","clear","getState","setRegistered","register","accumulatedData","data","setCustomer","customer"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,kBAAe;AAC3C,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,eAAY;AAE3D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,cAAc,QAAQ,qBAAkB;AAMjD,OAAO,SAASC,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAACL,YAAY,CAAC,CAAC,EAAE;IACnB,MAAM,IAAIM,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACD,YAAY,CAACE,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACAL,gBAAgB,CAACI,YAAY,CAACE,UAAU,CAAC;EACzCR,WAAW,CAACS,KAAK,CAAC,CAAC;EACnBN,WAAW,CAACO,QAAQ,CAAC,CAAC,CAACC,aAAa,CAAC,IAAI,CAAC;EAC1CX,WAAW,CAACY,QAAQ,CAAC,MAAOC,eAAsC,IAAK;IACrE,MAAMC,IAAI,GAAG,MAAMV,cAAc,
|
|
1
|
+
{"version":3,"names":["accumulator","isInitCalled","setLoginForAxios","useAppStore","updateCustomer","login","loginOptions","Error","externalId","clear","getState","setRegistered","register","accumulatedData","data","setCustomer","customer","error","console"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,kBAAe;AAC3C,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,eAAY;AAE3D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,cAAc,QAAQ,qBAAkB;AAMjD,OAAO,SAASC,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAACL,YAAY,CAAC,CAAC,EAAE;IACnB,MAAM,IAAIM,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACD,YAAY,CAACE,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACAL,gBAAgB,CAACI,YAAY,CAACE,UAAU,CAAC;EACzCR,WAAW,CAACS,KAAK,CAAC,CAAC;EACnBN,WAAW,CAACO,QAAQ,CAAC,CAAC,CAACC,aAAa,CAAC,IAAI,CAAC;EAC1CX,WAAW,CAACY,QAAQ,CAAC,MAAOC,eAAsC,IAAK;IACrE,IAAI;MACF,MAAMC,IAAI,GAAG,MAAMV,cAAc,CAC/BS,eAAe,EACfP,YAAY,CAACE,UACf,CAAC;MACDL,WAAW,CAACO,QAAQ,CAAC,CAAC,CAACK,WAAW,CAACD,IAAI,CAACE,QAAQ,CAAC;IACnD,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,yBAAyB,EAAEA,KAAK,CAAC;IACjD;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,oBAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
1
2
|
export declare enum NotificationPermissionStatus {
|
|
2
3
|
GRANTED = "granted",
|
|
3
4
|
DENIED = "denied",
|
|
4
5
|
BLOCKED = "blocked"
|
|
5
6
|
}
|
|
6
|
-
export
|
|
7
|
-
logLevel?:
|
|
7
|
+
export type InitializeOptions = {
|
|
8
|
+
logLevel?: string;
|
|
9
|
+
};
|
|
10
|
+
export type InitializeResult = {
|
|
11
|
+
success: boolean;
|
|
12
|
+
country: string;
|
|
13
|
+
language: string;
|
|
14
|
+
timezone: string;
|
|
15
|
+
};
|
|
16
|
+
export interface Spec extends TurboModule {
|
|
17
|
+
initialize(options: InitializeOptions | null): Promise<InitializeResult>;
|
|
18
|
+
checkOptIn(): Promise<string>;
|
|
19
|
+
optIn(): Promise<string>;
|
|
20
|
+
linkToSettings(): Promise<boolean>;
|
|
21
|
+
copyToClipboard(text: string): Promise<boolean>;
|
|
22
|
+
addListener(eventName: string): void;
|
|
23
|
+
removeListeners(count: number): void;
|
|
8
24
|
}
|
|
25
|
+
declare const NativeComnyxModule: Spec | null;
|
|
26
|
+
export default NativeComnyxModule;
|
|
9
27
|
export interface NativeComnyx {
|
|
10
|
-
initialize(options?: InitializeOptions): Promise<
|
|
11
|
-
success: boolean;
|
|
12
|
-
country: string;
|
|
13
|
-
language: string;
|
|
14
|
-
timezone: string;
|
|
15
|
-
}>;
|
|
28
|
+
initialize(options?: InitializeOptions): Promise<InitializeResult>;
|
|
16
29
|
checkOptIn(): Promise<NotificationPermissionStatus>;
|
|
17
30
|
optIn(): Promise<NotificationPermissionStatus>;
|
|
18
31
|
linkToSettings(): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeComnyx.d.ts","sourceRoot":"","sources":["../../../src/NativeComnyx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeComnyx.d.ts","sourceRoot":"","sources":["../../../src/NativeComnyx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,oBAAY,4BAA4B;IACtC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACzE,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAGD,QAAA,MAAM,kBAAkB,aAA0C,CAAC;AAEnE,eAAe,kBAAkB,CAAC;AAGlC,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnE,UAAU,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACpD,KAAK,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/C,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,YAAY,cAAgD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/register/login.ts"],"names":[],"mappings":"AAMA,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,YAAY,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/register/login.ts"],"names":[],"mappings":"AAMA,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,YAAY,EAAE,YAAY,QAqB/C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.12.
|
|
1
|
+
export declare const VERSION = "0.12.15";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.15",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
|
-
"main": "./
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
8
8
|
"types": "./lib/typescript/src/index.d.ts",
|
|
9
9
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"react-native-builder-bob": "^0.33.1",
|
|
89
89
|
"react-test-renderer": "^19.0.0",
|
|
90
90
|
"release-it": "^17.10.0",
|
|
91
|
-
"ts-jest": "^29.
|
|
91
|
+
"ts-jest": "^29.4.5",
|
|
92
92
|
"ts-node": "^10.9.2",
|
|
93
93
|
"typescript": "5.1.6",
|
|
94
94
|
"use-sync-external-store": "^1.5.0",
|
package/src/NativeComnyx.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
2
3
|
|
|
3
4
|
export enum NotificationPermissionStatus {
|
|
4
5
|
GRANTED = 'granted',
|
|
@@ -6,20 +7,39 @@ export enum NotificationPermissionStatus {
|
|
|
6
7
|
BLOCKED = 'blocked',
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export
|
|
10
|
-
logLevel?:
|
|
10
|
+
export type InitializeOptions = {
|
|
11
|
+
logLevel?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type InitializeResult = {
|
|
15
|
+
success: boolean;
|
|
16
|
+
country: string;
|
|
17
|
+
language: string;
|
|
18
|
+
timezone: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export interface Spec extends TurboModule {
|
|
22
|
+
initialize(options: InitializeOptions | null): Promise<InitializeResult>;
|
|
23
|
+
checkOptIn(): Promise<string>;
|
|
24
|
+
optIn(): Promise<string>;
|
|
25
|
+
linkToSettings(): Promise<boolean>;
|
|
26
|
+
copyToClipboard(text: string): Promise<boolean>;
|
|
27
|
+
addListener(eventName: string): void;
|
|
28
|
+
removeListeners(count: number): void;
|
|
11
29
|
}
|
|
30
|
+
|
|
31
|
+
// Single TurboModule registry call for Codegen
|
|
32
|
+
const NativeComnyxModule = TurboModuleRegistry.get<Spec>('Comnyx');
|
|
33
|
+
|
|
34
|
+
export default NativeComnyxModule;
|
|
35
|
+
|
|
36
|
+
// Legacy export for backward compatibility
|
|
12
37
|
export interface NativeComnyx {
|
|
13
|
-
initialize(options?: InitializeOptions): Promise<
|
|
14
|
-
success: boolean;
|
|
15
|
-
country: string;
|
|
16
|
-
language: string;
|
|
17
|
-
timezone: string;
|
|
18
|
-
}>;
|
|
38
|
+
initialize(options?: InitializeOptions): Promise<InitializeResult>;
|
|
19
39
|
checkOptIn(): Promise<NotificationPermissionStatus>;
|
|
20
40
|
optIn(): Promise<NotificationPermissionStatus>;
|
|
21
41
|
linkToSettings(): Promise<boolean>;
|
|
22
42
|
copyToClipboard(text: string): Promise<boolean>;
|
|
23
43
|
}
|
|
24
44
|
|
|
25
|
-
export const nativeComnyx =
|
|
45
|
+
export const nativeComnyx = NativeComnyxModule as unknown as NativeComnyx;
|
package/src/register/login.ts
CHANGED
|
@@ -19,7 +19,14 @@ export function login(loginOptions: LoginOptions) {
|
|
|
19
19
|
accumulator.clear();
|
|
20
20
|
useAppStore.getState().setRegistered(true);
|
|
21
21
|
accumulator.register(async (accumulatedData: CreateCustomerRequest) => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
try {
|
|
23
|
+
const data = await updateCustomer(
|
|
24
|
+
accumulatedData,
|
|
25
|
+
loginOptions.externalId
|
|
26
|
+
);
|
|
27
|
+
useAppStore.getState().setCustomer(data.customer);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('[Comnyx] Error in login', error);
|
|
30
|
+
}
|
|
24
31
|
});
|
|
25
32
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const VERSION = '0.12.
|
|
2
|
+
export const VERSION = '0.12.15';
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
version = "0.78.1"
|
|
7
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
-
if version == '1000.0.0'
|
|
9
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
-
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
-
else
|
|
12
|
-
source[:tag] = "v#{version}"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
Pod::Spec.new do |s|
|
|
16
|
-
s.name = "ReactAppDependencyProvider"
|
|
17
|
-
s.version = version
|
|
18
|
-
s.summary = "The third party dependency provider for the app"
|
|
19
|
-
s.homepage = "https://reactnative.dev/"
|
|
20
|
-
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
-
s.license = "MIT"
|
|
22
|
-
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
-
s.platforms = min_supported_versions
|
|
24
|
-
s.source = source
|
|
25
|
-
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
-
|
|
27
|
-
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
-
s.pod_target_xcconfig = {
|
|
29
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
-
"DEFINES_MODULE" => "YES"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
s.dependency "ReactCodegen"
|
|
34
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNComnyxSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNComnyxSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNComnyxSpec PUBLIC . react/renderer/components/RNComnyxSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNComnyxSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNComnyxSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "RNComnyxSpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
std::shared_ptr<TurboModule> RNComnyxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
18
|
-
|
|
19
|
-
return nullptr;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
JSI_EXPORT
|
|
22
|
-
std::shared_ptr<TurboModule> RNComnyxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} // namespace facebook::react
|
|
@@ -1,19 +0,0 @@
|
|
|
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: GenerateModuleH.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <ReactCommon/TurboModule.h>
|
|
13
|
-
#include <react/bridging/Bridging.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} // namespace facebook::react
|