@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.
Files changed (98) hide show
  1. package/Comnyx.podspec +23 -10
  2. package/android/build.gradle +60 -4
  3. package/android/generated/RCTAppDependencyProvider.h +25 -0
  4. package/android/generated/RCTAppDependencyProvider.mm +55 -0
  5. package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  6. package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  7. package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
  8. package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  9. package/android/generated/ReactAppDependencyProvider.podspec +34 -0
  10. package/android/generated/java/com/comnyx/NativeComnyxSpec.java +46 -0
  11. package/android/generated/jni/CMakeLists.txt +36 -0
  12. package/android/generated/jni/RNComnyxSpec-generated.cpp +44 -0
  13. package/android/generated/jni/RNComnyxSpec.h +31 -0
  14. package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +38 -0
  15. package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +89 -0
  16. package/android/src/main/java/com/comnyx/ComnyxModule.kt +15 -16
  17. package/ios/Comnyx.h +17 -0
  18. package/ios/Comnyx.m +7 -5
  19. package/ios/Comnyx.swift +11 -10
  20. package/ios/ComnyxObjC.h +19 -0
  21. package/ios/ComnyxObjC.m +28 -0
  22. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  23. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  24. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  25. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  26. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  27. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  28. package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +53 -0
  29. package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +67 -0
  30. package/ios/generated/RNComnyxSpecJSI-generated.cpp +38 -0
  31. package/ios/generated/RNComnyxSpecJSI.h +89 -0
  32. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  33. package/lib/commonjs/NativeComnyx.js +5 -2
  34. package/lib/commonjs/NativeComnyx.js.map +1 -1
  35. package/lib/commonjs/components/ChatList.js +53 -125
  36. package/lib/commonjs/components/ChatList.js.map +1 -1
  37. package/lib/commonjs/constants/translations.js +58 -0
  38. package/lib/commonjs/constants/translations.js.map +1 -1
  39. package/lib/commonjs/hooks/usePolling.js.map +1 -1
  40. package/lib/commonjs/register/Accumulator.js.map +1 -1
  41. package/lib/commonjs/store/store.js +2 -3
  42. package/lib/commonjs/store/store.js.map +1 -1
  43. package/lib/commonjs/utils/formatDate.js +30 -9
  44. package/lib/commonjs/utils/formatDate.js.map +1 -1
  45. package/lib/commonjs/utils/mmkvStorage.js +21 -0
  46. package/lib/commonjs/utils/mmkvStorage.js.map +1 -0
  47. package/lib/commonjs/version.js +1 -1
  48. package/lib/commonjs/version.js.map +1 -1
  49. package/lib/module/NativeComnyx.js +8 -2
  50. package/lib/module/NativeComnyx.js.map +1 -1
  51. package/lib/module/components/ChatList.js +54 -126
  52. package/lib/module/components/ChatList.js.map +1 -1
  53. package/lib/module/constants/translations.js +58 -0
  54. package/lib/module/constants/translations.js.map +1 -1
  55. package/lib/module/hooks/usePolling.js.map +1 -1
  56. package/lib/module/register/Accumulator.js.map +1 -1
  57. package/lib/module/store/store.js +2 -2
  58. package/lib/module/store/store.js.map +1 -1
  59. package/lib/module/utils/formatDate.js +28 -8
  60. package/lib/module/utils/formatDate.js.map +1 -1
  61. package/lib/module/utils/mmkvStorage.js +17 -0
  62. package/lib/module/utils/mmkvStorage.js.map +1 -0
  63. package/lib/module/version.js +1 -1
  64. package/lib/module/version.js.map +1 -1
  65. package/lib/typescript/src/NativeComnyx.d.ts +21 -8
  66. package/lib/typescript/src/NativeComnyx.d.ts.map +1 -1
  67. package/lib/typescript/src/api/conversations.d.ts +1 -1
  68. package/lib/typescript/src/api/conversations.d.ts.map +1 -1
  69. package/lib/typescript/src/components/AppText.d.ts +1 -1
  70. package/lib/typescript/src/components/AppText.d.ts.map +1 -1
  71. package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
  72. package/lib/typescript/src/constants/translations.d.ts.map +1 -1
  73. package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts +1 -1
  74. package/lib/typescript/src/hooks/useListenNativeTokenForDebug.d.ts.map +1 -1
  75. package/lib/typescript/src/register/Accumulator.d.ts +1 -1
  76. package/lib/typescript/src/register/Accumulator.d.ts.map +1 -1
  77. package/lib/typescript/src/store/store.d.ts.map +1 -1
  78. package/lib/typescript/src/types/LocalizationKeys.d.ts +2 -0
  79. package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
  80. package/lib/typescript/src/utils/formatDate.d.ts +1 -0
  81. package/lib/typescript/src/utils/formatDate.d.ts.map +1 -1
  82. package/lib/typescript/src/utils/mmkvStorage.d.ts +3 -0
  83. package/lib/typescript/src/utils/mmkvStorage.d.ts.map +1 -0
  84. package/lib/typescript/src/version.d.ts +1 -1
  85. package/lib/typescript/src/version.d.ts.map +1 -1
  86. package/package.json +21 -12
  87. package/src/NativeComnyx.ts +30 -10
  88. package/src/components/ChatList.tsx +101 -174
  89. package/src/constants/translations.ts +58 -0
  90. package/src/hooks/usePolling.ts +1 -1
  91. package/src/register/Accumulator.ts +1 -1
  92. package/src/store/store.ts +2 -2
  93. package/src/types/LocalizationKeys.ts +2 -0
  94. package/src/utils/formatDate.ts +46 -9
  95. package/src/utils/mmkvStorage.ts +17 -0
  96. package/src/version.ts +1 -1
  97. package/lib/typescript/jest.config.d.ts +0 -4
  98. package/lib/typescript/jest.config.d.ts.map +0 -1
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,m,swift}"
17
- s.private_header_files = "ios/generated/**/*.h"
18
-
19
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21
- if respond_to?(:install_modules_dependencies, true)
22
- install_modules_dependencies(s)
23
- else
24
- s.dependency "React-Core"
25
- end
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
@@ -65,15 +65,18 @@ android {
65
65
  }
66
66
 
67
67
  compileOptions {
68
- sourceCompatibility JavaVersion.VERSION_1_8
69
- targetCompatibility JavaVersion.VERSION_1_8
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
  }
@@ -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,34 @@
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
@@ -0,0 +1,46 @@
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: GenerateModuleJavaSpec.js
9
+ *
10
+ * @nolint
11
+ */
12
+
13
+ package com.comnyx;
14
+
15
+ import com.facebook.proguard.annotations.DoNotStrip;
16
+ import com.facebook.react.bridge.Promise;
17
+ import com.facebook.react.bridge.ReactApplicationContext;
18
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
+ import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
21
+ import javax.annotation.Nonnull;
22
+
23
+ public abstract class NativeComnyxSpec extends ReactContextBaseJavaModule implements TurboModule {
24
+ public static final String NAME = "Comnyx";
25
+
26
+ public NativeComnyxSpec(ReactApplicationContext reactContext) {
27
+ super(reactContext);
28
+ }
29
+
30
+ @Override
31
+ public @Nonnull String getName() {
32
+ return NAME;
33
+ }
34
+
35
+ @ReactMethod
36
+ @DoNotStrip
37
+ public abstract void initialize(Promise promise);
38
+
39
+ @ReactMethod
40
+ @DoNotStrip
41
+ public abstract void checkOptIn(Promise promise);
42
+
43
+ @ReactMethod
44
+ @DoNotStrip
45
+ public abstract void optIn(Promise promise);
46
+ }
@@ -0,0 +1,36 @@
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
+ )
@@ -0,0 +1,44 @@
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
+ static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
+ static jmethodID cachedMethodId = nullptr;
17
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initialize", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
+ }
19
+
20
+ static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_checkOptIn(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
+ static jmethodID cachedMethodId = nullptr;
22
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "checkOptIn", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
+ }
24
+
25
+ static facebook::jsi::Value __hostFunction_NativeComnyxSpecJSI_optIn(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
26
+ static jmethodID cachedMethodId = nullptr;
27
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "optIn", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
+ }
29
+
30
+ NativeComnyxSpecJSI::NativeComnyxSpecJSI(const JavaTurboModule::InitParams &params)
31
+ : JavaTurboModule(params) {
32
+ methodMap_["initialize"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_initialize};
33
+ methodMap_["checkOptIn"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_checkOptIn};
34
+ methodMap_["optIn"] = MethodMetadata {0, __hostFunction_NativeComnyxSpecJSI_optIn};
35
+ }
36
+
37
+ std::shared_ptr<TurboModule> RNComnyxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
38
+ if (moduleName == "Comnyx") {
39
+ return std::make_shared<NativeComnyxSpecJSI>(params);
40
+ }
41
+ return nullptr;
42
+ }
43
+
44
+ } // namespace facebook::react
@@ -0,0 +1,31 @@
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
+ * JNI C++ class for module 'NativeComnyx'
21
+ */
22
+ class JSI_EXPORT NativeComnyxSpecJSI : public JavaTurboModule {
23
+ public:
24
+ NativeComnyxSpecJSI(const JavaTurboModule::InitParams &params);
25
+ };
26
+
27
+
28
+ JSI_EXPORT
29
+ std::shared_ptr<TurboModule> RNComnyxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
+
31
+ } // namespace facebook::react
@@ -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
@@ -0,0 +1,89 @@
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
+ class JSI_EXPORT NativeComnyxCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeComnyxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual jsi::Value initialize(jsi::Runtime &rt) = 0;
24
+ virtual jsi::Value checkOptIn(jsi::Runtime &rt) = 0;
25
+ virtual jsi::Value optIn(jsi::Runtime &rt) = 0;
26
+
27
+ };
28
+
29
+ template <typename T>
30
+ class JSI_EXPORT NativeComnyxCxxSpec : public TurboModule {
31
+ public:
32
+ jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
33
+ return delegate_.create(rt, propName);
34
+ }
35
+
36
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
37
+ return delegate_.getPropertyNames(runtime);
38
+ }
39
+
40
+ static constexpr std::string_view kModuleName = "Comnyx";
41
+
42
+ protected:
43
+ NativeComnyxCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
44
+ : TurboModule(std::string{NativeComnyxCxxSpec::kModuleName}, jsInvoker),
45
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
46
+
47
+
48
+ private:
49
+ class Delegate : public NativeComnyxCxxSpecJSI {
50
+ public:
51
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
52
+ NativeComnyxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
53
+
54
+ }
55
+
56
+ jsi::Value initialize(jsi::Runtime &rt) override {
57
+ static_assert(
58
+ bridging::getParameterCount(&T::initialize) == 1,
59
+ "Expected initialize(...) to have 1 parameters");
60
+
61
+ return bridging::callFromJs<jsi::Value>(
62
+ rt, &T::initialize, jsInvoker_, instance_);
63
+ }
64
+ jsi::Value checkOptIn(jsi::Runtime &rt) override {
65
+ static_assert(
66
+ bridging::getParameterCount(&T::checkOptIn) == 1,
67
+ "Expected checkOptIn(...) to have 1 parameters");
68
+
69
+ return bridging::callFromJs<jsi::Value>(
70
+ rt, &T::checkOptIn, jsInvoker_, instance_);
71
+ }
72
+ jsi::Value optIn(jsi::Runtime &rt) override {
73
+ static_assert(
74
+ bridging::getParameterCount(&T::optIn) == 1,
75
+ "Expected optIn(...) to have 1 parameters");
76
+
77
+ return bridging::callFromJs<jsi::Value>(
78
+ rt, &T::optIn, jsInvoker_, instance_);
79
+ }
80
+
81
+ private:
82
+ friend class NativeComnyxCxxSpec;
83
+ T *instance_;
84
+ };
85
+
86
+ Delegate delegate_;
87
+ };
88
+
89
+ } // namespace facebook::react