@stream-io/react-native-callingx 0.1.0-beta.6 → 0.1.0-beta.7

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 (21) hide show
  1. package/package.json +1 -1
  2. package/android/bin/build/generated/source/buildConfig/debug/io/getstream/rn/callingx/BuildConfig.class +0 -0
  3. package/android/bin/build/generated/source/codegen/java/io/getstream/rn/callingx/NativeCallingxSpec.class +0 -0
  4. package/android/bin/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  5. package/android/bin/build/generated/source/codegen/jni/CallingxSpec-generated.cpp +0 -167
  6. package/android/bin/build/generated/source/codegen/jni/CallingxSpec.h +0 -31
  7. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI-generated.cpp +0 -196
  8. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI.h +0 -283
  9. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.cpp +0 -22
  10. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.h +0 -24
  11. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.cpp +0 -16
  12. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.h +0 -17
  13. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.cpp +0 -19
  14. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.h +0 -18
  15. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.cpp +0 -17
  16. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.h +0 -23
  17. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.cpp +0 -16
  18. package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.h +0 -20
  19. package/android/bin/build/generated/source/codegen/schema.json +0 -1
  20. package/android/bin/src/main/AndroidManifest.xml +0 -29
  21. package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +0 -104
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/react-native-callingx",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
4
4
  "description": "CallKit and Telecom API capabilities for React Native",
5
5
  "main": "./dist/module/index.js",
6
6
  "module": "./dist/module/index.js",
@@ -1,28 +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/CallingxSpec/*.cpp)
10
-
11
- add_library(
12
- react_codegen_CallingxSpec
13
- OBJECT
14
- ${react_codegen_SRCS}
15
- )
16
-
17
- target_include_directories(react_codegen_CallingxSpec PUBLIC . react/renderer/components/CallingxSpec)
18
-
19
- target_link_libraries(
20
- react_codegen_CallingxSpec
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_reactnative_options(react_codegen_CallingxSpec PRIVATE)
@@ -1,167 +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 "CallingxSpec.h"
12
-
13
- namespace facebook::react {
14
-
15
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setupiOS(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, VoidKind, "setupiOS", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
18
- }
19
-
20
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setupAndroid(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, VoidKind, "setupAndroid", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
23
- }
24
-
25
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setShouldRejectCallWhenBusy(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, VoidKind, "setShouldRejectCallWhenBusy", "(Z)V", args, count, cachedMethodId);
28
- }
29
-
30
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_canPostNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
- static jmethodID cachedMethodId = nullptr;
32
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, BooleanKind, "canPostNotifications", "()Z", args, count, cachedMethodId);
33
- }
34
-
35
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_getInitialEvents(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
36
- static jmethodID cachedMethodId = nullptr;
37
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ArrayKind, "getInitialEvents", "()Lcom/facebook/react/bridge/WritableArray;", args, count, cachedMethodId);
38
- }
39
-
40
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_getInitialVoipEvents(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
41
- static jmethodID cachedMethodId = nullptr;
42
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ArrayKind, "getInitialVoipEvents", "()Lcom/facebook/react/bridge/WritableArray;", args, count, cachedMethodId);
43
- }
44
-
45
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setCurrentCallActive(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
46
- static jmethodID cachedMethodId = nullptr;
47
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setCurrentCallActive", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
48
- }
49
-
50
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_displayIncomingCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
51
- static jmethodID cachedMethodId = nullptr;
52
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "displayIncomingCall", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
53
- }
54
-
55
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_answerIncomingCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
56
- static jmethodID cachedMethodId = nullptr;
57
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "answerIncomingCall", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
58
- }
59
-
60
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_startCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
61
- static jmethodID cachedMethodId = nullptr;
62
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "startCall", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
63
- }
64
-
65
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_updateDisplay(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
66
- static jmethodID cachedMethodId = nullptr;
67
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "updateDisplay", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
68
- }
69
-
70
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_isCallRegistered(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
71
- static jmethodID cachedMethodId = nullptr;
72
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, BooleanKind, "isCallRegistered", "(Ljava/lang/String;)Z", args, count, cachedMethodId);
73
- }
74
-
75
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_hasRegisteredCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
76
- static jmethodID cachedMethodId = nullptr;
77
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, BooleanKind, "hasRegisteredCall", "()Z", args, count, cachedMethodId);
78
- }
79
-
80
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_endCallWithReason(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
81
- static jmethodID cachedMethodId = nullptr;
82
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "endCallWithReason", "(Ljava/lang/String;DLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
83
- }
84
-
85
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_endCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
86
- static jmethodID cachedMethodId = nullptr;
87
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "endCall", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
88
- }
89
-
90
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setMutedCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
91
- static jmethodID cachedMethodId = nullptr;
92
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setMutedCall", "(Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
93
- }
94
-
95
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_setOnHoldCall(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
96
- static jmethodID cachedMethodId = nullptr;
97
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setOnHoldCall", "(Ljava/lang/String;ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
98
- }
99
-
100
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_registerBackgroundTaskAvailable(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
101
- static jmethodID cachedMethodId = nullptr;
102
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "registerBackgroundTaskAvailable", "()V", args, count, cachedMethodId);
103
- }
104
-
105
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_isServiceStarted(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
106
- static jmethodID cachedMethodId = nullptr;
107
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "isServiceStarted", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
108
- }
109
-
110
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_startBackgroundTask(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
111
- static jmethodID cachedMethodId = nullptr;
112
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "startBackgroundTask", "(Ljava/lang/String;DLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
113
- }
114
-
115
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_stopBackgroundTask(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
116
- static jmethodID cachedMethodId = nullptr;
117
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "stopBackgroundTask", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
118
- }
119
-
120
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_registerVoipToken(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
121
- static jmethodID cachedMethodId = nullptr;
122
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "registerVoipToken", "()V", args, count, cachedMethodId);
123
- }
124
-
125
- static facebook::jsi::Value __hostFunction_NativeCallingxSpecJSI_log(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
126
- static jmethodID cachedMethodId = nullptr;
127
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "log", "(Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
128
- }
129
-
130
- NativeCallingxSpecJSI::NativeCallingxSpecJSI(const JavaTurboModule::InitParams &params)
131
- : JavaTurboModule(params) {
132
- methodMap_["setupiOS"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_setupiOS};
133
- methodMap_["setupAndroid"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_setupAndroid};
134
- methodMap_["setShouldRejectCallWhenBusy"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_setShouldRejectCallWhenBusy};
135
- methodMap_["canPostNotifications"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_canPostNotifications};
136
- methodMap_["getInitialEvents"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_getInitialEvents};
137
- methodMap_["getInitialVoipEvents"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_getInitialVoipEvents};
138
- methodMap_["setCurrentCallActive"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_setCurrentCallActive};
139
- methodMap_["displayIncomingCall"] = MethodMetadata {5, __hostFunction_NativeCallingxSpecJSI_displayIncomingCall};
140
- methodMap_["answerIncomingCall"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_answerIncomingCall};
141
- methodMap_["startCall"] = MethodMetadata {5, __hostFunction_NativeCallingxSpecJSI_startCall};
142
- methodMap_["updateDisplay"] = MethodMetadata {4, __hostFunction_NativeCallingxSpecJSI_updateDisplay};
143
- methodMap_["isCallRegistered"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_isCallRegistered};
144
- methodMap_["hasRegisteredCall"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_hasRegisteredCall};
145
- methodMap_["endCallWithReason"] = MethodMetadata {2, __hostFunction_NativeCallingxSpecJSI_endCallWithReason};
146
- methodMap_["endCall"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_endCall};
147
- methodMap_["setMutedCall"] = MethodMetadata {2, __hostFunction_NativeCallingxSpecJSI_setMutedCall};
148
- methodMap_["setOnHoldCall"] = MethodMetadata {2, __hostFunction_NativeCallingxSpecJSI_setOnHoldCall};
149
- methodMap_["registerBackgroundTaskAvailable"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_registerBackgroundTaskAvailable};
150
- methodMap_["isServiceStarted"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_isServiceStarted};
151
- methodMap_["startBackgroundTask"] = MethodMetadata {2, __hostFunction_NativeCallingxSpecJSI_startBackgroundTask};
152
- methodMap_["stopBackgroundTask"] = MethodMetadata {1, __hostFunction_NativeCallingxSpecJSI_stopBackgroundTask};
153
- methodMap_["registerVoipToken"] = MethodMetadata {0, __hostFunction_NativeCallingxSpecJSI_registerVoipToken};
154
- methodMap_["log"] = MethodMetadata {2, __hostFunction_NativeCallingxSpecJSI_log};
155
- eventEmitterMap_["onNewEvent"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
156
- eventEmitterMap_["onNewVoipEvent"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
157
- configureEventEmitterCallback();
158
- }
159
-
160
- std::shared_ptr<TurboModule> CallingxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
161
- if (moduleName == "Callingx") {
162
- return std::make_shared<NativeCallingxSpecJSI>(params);
163
- }
164
- return nullptr;
165
- }
166
-
167
- } // namespace facebook::react
@@ -1,31 +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
- * JNI C++ class for module 'NativeCallingx'
21
- */
22
- class JSI_EXPORT NativeCallingxSpecJSI : public JavaTurboModule {
23
- public:
24
- NativeCallingxSpecJSI(const JavaTurboModule::InitParams &params);
25
- };
26
-
27
-
28
- JSI_EXPORT
29
- std::shared_ptr<TurboModule> CallingxSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
-
31
- } // namespace facebook::react
@@ -1,196 +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 "CallingxSpecJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setupiOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setupiOS(
16
- rt,
17
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
18
- );
19
- return jsi::Value::undefined();
20
- }
21
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setupAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
22
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setupAndroid(
23
- rt,
24
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
25
- );
26
- return jsi::Value::undefined();
27
- }
28
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setShouldRejectCallWhenBusy(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
29
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setShouldRejectCallWhenBusy(
30
- rt,
31
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
32
- );
33
- return jsi::Value::undefined();
34
- }
35
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_canPostNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->canPostNotifications(
37
- rt
38
- );
39
- }
40
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_getInitialEvents(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
41
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->getInitialEvents(
42
- rt
43
- );
44
- }
45
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_getInitialVoipEvents(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
46
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->getInitialVoipEvents(
47
- rt
48
- );
49
- }
50
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setCurrentCallActive(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
51
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setCurrentCallActive(
52
- rt,
53
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
54
- );
55
- }
56
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_displayIncomingCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
57
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->displayIncomingCall(
58
- rt,
59
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
60
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
61
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
62
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asBool(),
63
- count <= 4 || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asObject(rt))
64
- );
65
- }
66
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_answerIncomingCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
67
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->answerIncomingCall(
68
- rt,
69
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
70
- );
71
- }
72
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_startCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
73
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->startCall(
74
- rt,
75
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
76
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
77
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
78
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asBool(),
79
- count <= 4 || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asObject(rt))
80
- );
81
- }
82
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_updateDisplay(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
83
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->updateDisplay(
84
- rt,
85
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
86
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
87
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
88
- count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asObject(rt))
89
- );
90
- }
91
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_isCallRegistered(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
92
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->isCallRegistered(
93
- rt,
94
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
95
- );
96
- }
97
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_hasRegisteredCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
98
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->hasRegisteredCall(
99
- rt
100
- );
101
- }
102
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_endCallWithReason(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
103
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->endCallWithReason(
104
- rt,
105
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
106
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber()
107
- );
108
- }
109
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_endCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
110
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->endCall(
111
- rt,
112
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
113
- );
114
- }
115
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setMutedCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
116
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setMutedCall(
117
- rt,
118
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
119
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
120
- );
121
- }
122
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_setOnHoldCall(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
123
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->setOnHoldCall(
124
- rt,
125
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
126
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
127
- );
128
- }
129
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_registerBackgroundTaskAvailable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
130
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->registerBackgroundTaskAvailable(
131
- rt
132
- );
133
- return jsi::Value::undefined();
134
- }
135
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_isServiceStarted(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
136
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->isServiceStarted(
137
- rt
138
- );
139
- }
140
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_startBackgroundTask(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
141
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->startBackgroundTask(
142
- rt,
143
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
144
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber()
145
- );
146
- }
147
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_stopBackgroundTask(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
148
- return static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->stopBackgroundTask(
149
- rt,
150
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
151
- );
152
- }
153
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_registerVoipToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
154
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->registerVoipToken(
155
- rt
156
- );
157
- return jsi::Value::undefined();
158
- }
159
- static jsi::Value __hostFunction_NativeCallingxCxxSpecJSI_log(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
160
- static_cast<NativeCallingxCxxSpecJSI *>(&turboModule)->log(
161
- rt,
162
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
163
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
164
- );
165
- return jsi::Value::undefined();
166
- }
167
-
168
- NativeCallingxCxxSpecJSI::NativeCallingxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
169
- : TurboModule("Callingx", jsInvoker) {
170
- methodMap_["setupiOS"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_setupiOS};
171
- methodMap_["setupAndroid"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_setupAndroid};
172
- methodMap_["setShouldRejectCallWhenBusy"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_setShouldRejectCallWhenBusy};
173
- methodMap_["canPostNotifications"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_canPostNotifications};
174
- methodMap_["getInitialEvents"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_getInitialEvents};
175
- methodMap_["getInitialVoipEvents"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_getInitialVoipEvents};
176
- methodMap_["setCurrentCallActive"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_setCurrentCallActive};
177
- methodMap_["displayIncomingCall"] = MethodMetadata {5, __hostFunction_NativeCallingxCxxSpecJSI_displayIncomingCall};
178
- methodMap_["answerIncomingCall"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_answerIncomingCall};
179
- methodMap_["startCall"] = MethodMetadata {5, __hostFunction_NativeCallingxCxxSpecJSI_startCall};
180
- methodMap_["updateDisplay"] = MethodMetadata {4, __hostFunction_NativeCallingxCxxSpecJSI_updateDisplay};
181
- methodMap_["isCallRegistered"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_isCallRegistered};
182
- methodMap_["hasRegisteredCall"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_hasRegisteredCall};
183
- methodMap_["endCallWithReason"] = MethodMetadata {2, __hostFunction_NativeCallingxCxxSpecJSI_endCallWithReason};
184
- methodMap_["endCall"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_endCall};
185
- methodMap_["setMutedCall"] = MethodMetadata {2, __hostFunction_NativeCallingxCxxSpecJSI_setMutedCall};
186
- methodMap_["setOnHoldCall"] = MethodMetadata {2, __hostFunction_NativeCallingxCxxSpecJSI_setOnHoldCall};
187
- methodMap_["registerBackgroundTaskAvailable"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_registerBackgroundTaskAvailable};
188
- methodMap_["isServiceStarted"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_isServiceStarted};
189
- methodMap_["startBackgroundTask"] = MethodMetadata {2, __hostFunction_NativeCallingxCxxSpecJSI_startBackgroundTask};
190
- methodMap_["stopBackgroundTask"] = MethodMetadata {1, __hostFunction_NativeCallingxCxxSpecJSI_stopBackgroundTask};
191
- methodMap_["registerVoipToken"] = MethodMetadata {0, __hostFunction_NativeCallingxCxxSpecJSI_registerVoipToken};
192
- methodMap_["log"] = MethodMetadata {2, __hostFunction_NativeCallingxCxxSpecJSI_log};
193
- }
194
-
195
-
196
- } // namespace facebook::react
@@ -1,283 +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
- class JSI_EXPORT NativeCallingxCxxSpecJSI : public TurboModule {
19
- protected:
20
- NativeCallingxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
-
22
- public:
23
- virtual void setupiOS(jsi::Runtime &rt, jsi::Object options) = 0;
24
- virtual void setupAndroid(jsi::Runtime &rt, jsi::Object options) = 0;
25
- virtual void setShouldRejectCallWhenBusy(jsi::Runtime &rt, bool shouldReject) = 0;
26
- virtual bool canPostNotifications(jsi::Runtime &rt) = 0;
27
- virtual jsi::Array getInitialEvents(jsi::Runtime &rt) = 0;
28
- virtual jsi::Array getInitialVoipEvents(jsi::Runtime &rt) = 0;
29
- virtual jsi::Value setCurrentCallActive(jsi::Runtime &rt, jsi::String callId) = 0;
30
- virtual jsi::Value displayIncomingCall(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, bool hasVideo, std::optional<jsi::Object> displayOptions) = 0;
31
- virtual jsi::Value answerIncomingCall(jsi::Runtime &rt, jsi::String callId) = 0;
32
- virtual jsi::Value startCall(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, bool hasVideo, std::optional<jsi::Object> displayOptions) = 0;
33
- virtual jsi::Value updateDisplay(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, std::optional<jsi::Object> displayOptions) = 0;
34
- virtual bool isCallRegistered(jsi::Runtime &rt, jsi::String callId) = 0;
35
- virtual bool hasRegisteredCall(jsi::Runtime &rt) = 0;
36
- virtual jsi::Value endCallWithReason(jsi::Runtime &rt, jsi::String callId, double reason) = 0;
37
- virtual jsi::Value endCall(jsi::Runtime &rt, jsi::String callId) = 0;
38
- virtual jsi::Value setMutedCall(jsi::Runtime &rt, jsi::String callId, bool isMuted) = 0;
39
- virtual jsi::Value setOnHoldCall(jsi::Runtime &rt, jsi::String callId, bool isOnHold) = 0;
40
- virtual void registerBackgroundTaskAvailable(jsi::Runtime &rt) = 0;
41
- virtual jsi::Value isServiceStarted(jsi::Runtime &rt) = 0;
42
- virtual jsi::Value startBackgroundTask(jsi::Runtime &rt, jsi::String taskName, double timeout) = 0;
43
- virtual jsi::Value stopBackgroundTask(jsi::Runtime &rt, jsi::String taskName) = 0;
44
- virtual void registerVoipToken(jsi::Runtime &rt) = 0;
45
- virtual void log(jsi::Runtime &rt, jsi::String message, jsi::String level) = 0;
46
-
47
- };
48
-
49
- template <typename T>
50
- class JSI_EXPORT NativeCallingxCxxSpec : public TurboModule {
51
- public:
52
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
53
- return delegate_.create(rt, propName);
54
- }
55
-
56
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
57
- return delegate_.getPropertyNames(runtime);
58
- }
59
-
60
- static constexpr std::string_view kModuleName = "Callingx";
61
-
62
- protected:
63
- NativeCallingxCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
64
- : TurboModule(std::string{NativeCallingxCxxSpec::kModuleName}, jsInvoker),
65
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
66
-
67
- template <typename OnNewEventType> void emitOnNewEvent(OnNewEventType value) {
68
- static_assert(bridging::supportsFromJs<OnNewEventType, jsi::Object>, "value cannnot be converted to jsi::Object");
69
- static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onNewEvent"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
70
- return bridging::toJs(rt, eventValue, jsInvoker);
71
- });
72
- }
73
-
74
- template <typename OnNewVoipEventType> void emitOnNewVoipEvent(OnNewVoipEventType value) {
75
- static_assert(bridging::supportsFromJs<OnNewVoipEventType, jsi::Object>, "value cannnot be converted to jsi::Object");
76
- static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onNewVoipEvent"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
77
- return bridging::toJs(rt, eventValue, jsInvoker);
78
- });
79
- }
80
-
81
- private:
82
- class Delegate : public NativeCallingxCxxSpecJSI {
83
- public:
84
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
85
- NativeCallingxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
86
- eventEmitterMap_["onNewEvent"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
87
- eventEmitterMap_["onNewVoipEvent"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
88
- }
89
-
90
- void setupiOS(jsi::Runtime &rt, jsi::Object options) override {
91
- static_assert(
92
- bridging::getParameterCount(&T::setupiOS) == 2,
93
- "Expected setupiOS(...) to have 2 parameters");
94
-
95
- return bridging::callFromJs<void>(
96
- rt, &T::setupiOS, jsInvoker_, instance_, std::move(options));
97
- }
98
- void setupAndroid(jsi::Runtime &rt, jsi::Object options) override {
99
- static_assert(
100
- bridging::getParameterCount(&T::setupAndroid) == 2,
101
- "Expected setupAndroid(...) to have 2 parameters");
102
-
103
- return bridging::callFromJs<void>(
104
- rt, &T::setupAndroid, jsInvoker_, instance_, std::move(options));
105
- }
106
- void setShouldRejectCallWhenBusy(jsi::Runtime &rt, bool shouldReject) override {
107
- static_assert(
108
- bridging::getParameterCount(&T::setShouldRejectCallWhenBusy) == 2,
109
- "Expected setShouldRejectCallWhenBusy(...) to have 2 parameters");
110
-
111
- return bridging::callFromJs<void>(
112
- rt, &T::setShouldRejectCallWhenBusy, jsInvoker_, instance_, std::move(shouldReject));
113
- }
114
- bool canPostNotifications(jsi::Runtime &rt) override {
115
- static_assert(
116
- bridging::getParameterCount(&T::canPostNotifications) == 1,
117
- "Expected canPostNotifications(...) to have 1 parameters");
118
-
119
- return bridging::callFromJs<bool>(
120
- rt, &T::canPostNotifications, jsInvoker_, instance_);
121
- }
122
- jsi::Array getInitialEvents(jsi::Runtime &rt) override {
123
- static_assert(
124
- bridging::getParameterCount(&T::getInitialEvents) == 1,
125
- "Expected getInitialEvents(...) to have 1 parameters");
126
-
127
- return bridging::callFromJs<jsi::Array>(
128
- rt, &T::getInitialEvents, jsInvoker_, instance_);
129
- }
130
- jsi::Array getInitialVoipEvents(jsi::Runtime &rt) override {
131
- static_assert(
132
- bridging::getParameterCount(&T::getInitialVoipEvents) == 1,
133
- "Expected getInitialVoipEvents(...) to have 1 parameters");
134
-
135
- return bridging::callFromJs<jsi::Array>(
136
- rt, &T::getInitialVoipEvents, jsInvoker_, instance_);
137
- }
138
- jsi::Value setCurrentCallActive(jsi::Runtime &rt, jsi::String callId) override {
139
- static_assert(
140
- bridging::getParameterCount(&T::setCurrentCallActive) == 2,
141
- "Expected setCurrentCallActive(...) to have 2 parameters");
142
-
143
- return bridging::callFromJs<jsi::Value>(
144
- rt, &T::setCurrentCallActive, jsInvoker_, instance_, std::move(callId));
145
- }
146
- jsi::Value displayIncomingCall(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, bool hasVideo, std::optional<jsi::Object> displayOptions) override {
147
- static_assert(
148
- bridging::getParameterCount(&T::displayIncomingCall) == 6,
149
- "Expected displayIncomingCall(...) to have 6 parameters");
150
-
151
- return bridging::callFromJs<jsi::Value>(
152
- rt, &T::displayIncomingCall, jsInvoker_, instance_, std::move(callId), std::move(phoneNumber), std::move(callerName), std::move(hasVideo), std::move(displayOptions));
153
- }
154
- jsi::Value answerIncomingCall(jsi::Runtime &rt, jsi::String callId) override {
155
- static_assert(
156
- bridging::getParameterCount(&T::answerIncomingCall) == 2,
157
- "Expected answerIncomingCall(...) to have 2 parameters");
158
-
159
- return bridging::callFromJs<jsi::Value>(
160
- rt, &T::answerIncomingCall, jsInvoker_, instance_, std::move(callId));
161
- }
162
- jsi::Value startCall(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, bool hasVideo, std::optional<jsi::Object> displayOptions) override {
163
- static_assert(
164
- bridging::getParameterCount(&T::startCall) == 6,
165
- "Expected startCall(...) to have 6 parameters");
166
-
167
- return bridging::callFromJs<jsi::Value>(
168
- rt, &T::startCall, jsInvoker_, instance_, std::move(callId), std::move(phoneNumber), std::move(callerName), std::move(hasVideo), std::move(displayOptions));
169
- }
170
- jsi::Value updateDisplay(jsi::Runtime &rt, jsi::String callId, jsi::String phoneNumber, jsi::String callerName, std::optional<jsi::Object> displayOptions) override {
171
- static_assert(
172
- bridging::getParameterCount(&T::updateDisplay) == 5,
173
- "Expected updateDisplay(...) to have 5 parameters");
174
-
175
- return bridging::callFromJs<jsi::Value>(
176
- rt, &T::updateDisplay, jsInvoker_, instance_, std::move(callId), std::move(phoneNumber), std::move(callerName), std::move(displayOptions));
177
- }
178
- bool isCallRegistered(jsi::Runtime &rt, jsi::String callId) override {
179
- static_assert(
180
- bridging::getParameterCount(&T::isCallRegistered) == 2,
181
- "Expected isCallRegistered(...) to have 2 parameters");
182
-
183
- return bridging::callFromJs<bool>(
184
- rt, &T::isCallRegistered, jsInvoker_, instance_, std::move(callId));
185
- }
186
- bool hasRegisteredCall(jsi::Runtime &rt) override {
187
- static_assert(
188
- bridging::getParameterCount(&T::hasRegisteredCall) == 1,
189
- "Expected hasRegisteredCall(...) to have 1 parameters");
190
-
191
- return bridging::callFromJs<bool>(
192
- rt, &T::hasRegisteredCall, jsInvoker_, instance_);
193
- }
194
- jsi::Value endCallWithReason(jsi::Runtime &rt, jsi::String callId, double reason) override {
195
- static_assert(
196
- bridging::getParameterCount(&T::endCallWithReason) == 3,
197
- "Expected endCallWithReason(...) to have 3 parameters");
198
-
199
- return bridging::callFromJs<jsi::Value>(
200
- rt, &T::endCallWithReason, jsInvoker_, instance_, std::move(callId), std::move(reason));
201
- }
202
- jsi::Value endCall(jsi::Runtime &rt, jsi::String callId) override {
203
- static_assert(
204
- bridging::getParameterCount(&T::endCall) == 2,
205
- "Expected endCall(...) to have 2 parameters");
206
-
207
- return bridging::callFromJs<jsi::Value>(
208
- rt, &T::endCall, jsInvoker_, instance_, std::move(callId));
209
- }
210
- jsi::Value setMutedCall(jsi::Runtime &rt, jsi::String callId, bool isMuted) override {
211
- static_assert(
212
- bridging::getParameterCount(&T::setMutedCall) == 3,
213
- "Expected setMutedCall(...) to have 3 parameters");
214
-
215
- return bridging::callFromJs<jsi::Value>(
216
- rt, &T::setMutedCall, jsInvoker_, instance_, std::move(callId), std::move(isMuted));
217
- }
218
- jsi::Value setOnHoldCall(jsi::Runtime &rt, jsi::String callId, bool isOnHold) override {
219
- static_assert(
220
- bridging::getParameterCount(&T::setOnHoldCall) == 3,
221
- "Expected setOnHoldCall(...) to have 3 parameters");
222
-
223
- return bridging::callFromJs<jsi::Value>(
224
- rt, &T::setOnHoldCall, jsInvoker_, instance_, std::move(callId), std::move(isOnHold));
225
- }
226
- void registerBackgroundTaskAvailable(jsi::Runtime &rt) override {
227
- static_assert(
228
- bridging::getParameterCount(&T::registerBackgroundTaskAvailable) == 1,
229
- "Expected registerBackgroundTaskAvailable(...) to have 1 parameters");
230
-
231
- return bridging::callFromJs<void>(
232
- rt, &T::registerBackgroundTaskAvailable, jsInvoker_, instance_);
233
- }
234
- jsi::Value isServiceStarted(jsi::Runtime &rt) override {
235
- static_assert(
236
- bridging::getParameterCount(&T::isServiceStarted) == 1,
237
- "Expected isServiceStarted(...) to have 1 parameters");
238
-
239
- return bridging::callFromJs<jsi::Value>(
240
- rt, &T::isServiceStarted, jsInvoker_, instance_);
241
- }
242
- jsi::Value startBackgroundTask(jsi::Runtime &rt, jsi::String taskName, double timeout) override {
243
- static_assert(
244
- bridging::getParameterCount(&T::startBackgroundTask) == 3,
245
- "Expected startBackgroundTask(...) to have 3 parameters");
246
-
247
- return bridging::callFromJs<jsi::Value>(
248
- rt, &T::startBackgroundTask, jsInvoker_, instance_, std::move(taskName), std::move(timeout));
249
- }
250
- jsi::Value stopBackgroundTask(jsi::Runtime &rt, jsi::String taskName) override {
251
- static_assert(
252
- bridging::getParameterCount(&T::stopBackgroundTask) == 2,
253
- "Expected stopBackgroundTask(...) to have 2 parameters");
254
-
255
- return bridging::callFromJs<jsi::Value>(
256
- rt, &T::stopBackgroundTask, jsInvoker_, instance_, std::move(taskName));
257
- }
258
- void registerVoipToken(jsi::Runtime &rt) override {
259
- static_assert(
260
- bridging::getParameterCount(&T::registerVoipToken) == 1,
261
- "Expected registerVoipToken(...) to have 1 parameters");
262
-
263
- return bridging::callFromJs<void>(
264
- rt, &T::registerVoipToken, jsInvoker_, instance_);
265
- }
266
- void log(jsi::Runtime &rt, jsi::String message, jsi::String level) override {
267
- static_assert(
268
- bridging::getParameterCount(&T::log) == 3,
269
- "Expected log(...) to have 3 parameters");
270
-
271
- return bridging::callFromJs<void>(
272
- rt, &T::log, jsInvoker_, instance_, std::move(message), std::move(level));
273
- }
274
-
275
- private:
276
- friend class NativeCallingxCxxSpec;
277
- T *instance_;
278
- };
279
-
280
- Delegate delegate_;
281
- };
282
-
283
- } // namespace facebook::react
@@ -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: GenerateComponentDescriptorCpp.js
9
- */
10
-
11
- #include <react/renderer/components/CallingxSpec/ComponentDescriptors.h>
12
- #include <react/renderer/core/ConcreteComponentDescriptor.h>
13
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
14
-
15
- namespace facebook::react {
16
-
17
- void CallingxSpec_registerComponentDescriptorsFromCodegen(
18
- std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
19
-
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: GenerateComponentDescriptorH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <react/renderer/components/CallingxSpec/ShadowNodes.h>
14
- #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
-
17
- namespace facebook::react {
18
-
19
-
20
-
21
- void CallingxSpec_registerComponentDescriptorsFromCodegen(
22
- std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
-
24
- } // namespace facebook::react
@@ -1,16 +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: GenerateEventEmitterCpp.js
9
- */
10
-
11
- #include <react/renderer/components/CallingxSpec/EventEmitters.h>
12
-
13
-
14
- namespace facebook::react {
15
-
16
- } // namespace facebook::react
@@ -1,17 +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: GenerateEventEmitterH.js
9
- */
10
- #pragma once
11
-
12
- #include <react/renderer/components/view/ViewEventEmitter.h>
13
-
14
-
15
- namespace facebook::react {
16
-
17
- } // namespace facebook::react
@@ -1,19 +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: GeneratePropsCpp.js
9
- */
10
-
11
- #include <react/renderer/components/CallingxSpec/Props.h>
12
- #include <react/renderer/core/PropsParserContext.h>
13
- #include <react/renderer/core/propsConversions.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
@@ -1,18 +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: GeneratePropsH.js
9
- */
10
- #pragma once
11
-
12
-
13
-
14
- namespace facebook::react {
15
-
16
-
17
-
18
- } // namespace facebook::react
@@ -1,17 +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: GenerateShadowNodeCpp.js
9
- */
10
-
11
- #include <react/renderer/components/CallingxSpec/ShadowNodes.h>
12
-
13
- namespace facebook::react {
14
-
15
-
16
-
17
- } // namespace facebook::react
@@ -1,23 +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: GenerateShadowNodeH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <react/renderer/components/CallingxSpec/EventEmitters.h>
14
- #include <react/renderer/components/CallingxSpec/Props.h>
15
- #include <react/renderer/components/CallingxSpec/States.h>
16
- #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
- #include <jsi/jsi.h>
18
-
19
- namespace facebook::react {
20
-
21
-
22
-
23
- } // namespace facebook::react
@@ -1,16 +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: GenerateStateCpp.js
9
- */
10
- #include <react/renderer/components/CallingxSpec/States.h>
11
-
12
- namespace facebook::react {
13
-
14
-
15
-
16
- } // namespace facebook::react
@@ -1,20 +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: GenerateStateH.js
8
- */
9
- #pragma once
10
-
11
- #include <react/renderer/core/StateData.h>
12
- #ifdef RN_SERIALIZABLE_STATE
13
- #include <folly/dynamic.h>
14
- #endif
15
-
16
- namespace facebook::react {
17
-
18
-
19
-
20
- } // namespace facebook::react
@@ -1 +0,0 @@
1
- {"libraryName":"","modules":{"NativeCallingx":{"type":"NativeModule","aliasMap":{},"enumMap":{},"spec":{"eventEmitters":[{"name":"onNewEvent","optional":false,"typeAnnotation":{"type":"EventEmitterTypeAnnotation","typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"eventName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"params","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"cause","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"muted","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"hold","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation"}}]}}]}}},{"name":"onNewVoipEvent","optional":false,"typeAnnotation":{"type":"EventEmitterTypeAnnotation","typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"eventName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"params","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"token","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"aps","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}},{"name":"alert","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"title","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"category","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"sound","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"stream","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"sender","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"created_by_id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"body","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"title","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"call_display_name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"created_by_display_name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"version","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"type","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"receiver_id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"call_cid","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"video","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}}]}}}],"methods":[{"name":"setupiOS","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[{"name":"options","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"supportsVideo","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"maximumCallsPerCallGroup","optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}},{"name":"maximumCallGroups","optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}},{"name":"handleType","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"sound","optional":false,"typeAnnotation":{"type":"NullableTypeAnnotation","typeAnnotation":{"type":"StringTypeAnnotation"}}},{"name":"imageName","optional":false,"typeAnnotation":{"type":"NullableTypeAnnotation","typeAnnotation":{"type":"StringTypeAnnotation"}}},{"name":"callsHistory","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"displayCallTimeout","optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}}]}}]}},{"name":"setupAndroid","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[{"name":"options","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"incomingChannel","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"sound","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"vibration","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}}]}},{"name":"ongoingChannel","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}}]}},{"name":"setShouldRejectCallWhenBusy","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[{"name":"shouldReject","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}}]}},{"name":"canPostNotifications","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"BooleanTypeAnnotation"},"params":[]}},{"name":"getInitialEvents","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"ArrayTypeAnnotation","elementType":{"type":"ObjectTypeAnnotation","properties":[{"name":"eventName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"params","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"cause","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"muted","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"hold","optional":true,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"source","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}},"params":[]}},{"name":"getInitialVoipEvents","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"ArrayTypeAnnotation","elementType":{"type":"ObjectTypeAnnotation","properties":[{"name":"eventName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"params","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"token","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"aps","optional":true,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}},{"name":"alert","optional":false,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"title","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"category","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"sound","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"stream","optional":true,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"sender","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"created_by_id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"body","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"title","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"call_display_name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"created_by_display_name","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"version","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"type","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"receiver_id","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"call_cid","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"video","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}}]}},"params":[]}},{"name":"setCurrentCallActive","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"displayIncomingCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"phoneNumber","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"callerName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"hasVideo","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"displayOptions","optional":true,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"displayTitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"displaySubtitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}},{"name":"answerIncomingCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"startCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"phoneNumber","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"callerName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"hasVideo","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}},{"name":"displayOptions","optional":true,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"displayTitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"displaySubtitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}},{"name":"updateDisplay","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"phoneNumber","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"callerName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"displayOptions","optional":true,"typeAnnotation":{"type":"ObjectTypeAnnotation","properties":[{"name":"displayTitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"displaySubtitle","optional":true,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}}]}},{"name":"isCallRegistered","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"BooleanTypeAnnotation"},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"hasRegisteredCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"BooleanTypeAnnotation"},"params":[]}},{"name":"endCallWithReason","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"reason","optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}}]}},{"name":"endCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"setMutedCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"isMuted","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}}]}},{"name":"setOnHoldCall","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"callId","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"isOnHold","optional":false,"typeAnnotation":{"type":"BooleanTypeAnnotation"}}]}},{"name":"registerBackgroundTaskAvailable","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[]}},{"name":"isServiceStarted","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"BooleanTypeAnnotation"}},"params":[]}},{"name":"startBackgroundTask","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"taskName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"timeout","optional":false,"typeAnnotation":{"type":"NumberTypeAnnotation"}}]}},{"name":"stopBackgroundTask","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"PromiseTypeAnnotation","elementType":{"type":"VoidTypeAnnotation"}},"params":[{"name":"taskName","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}}]}},{"name":"registerVoipToken","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[]}},{"name":"log","optional":false,"typeAnnotation":{"type":"FunctionTypeAnnotation","returnTypeAnnotation":{"type":"VoidTypeAnnotation"},"params":[{"name":"message","optional":false,"typeAnnotation":{"type":"StringTypeAnnotation"}},{"name":"level","optional":false,"typeAnnotation":{"type":"StringLiteralUnionTypeAnnotation","types":[{"type":"StringLiteralTypeAnnotation","value":"debug"},{"type":"StringLiteralTypeAnnotation","value":"info"},{"type":"StringLiteralTypeAnnotation","value":"warn"},{"type":"StringLiteralTypeAnnotation","value":"error"}]}}]}}]},"moduleName":"Callingx"}}}
@@ -1,29 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
-
3
- <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
4
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
5
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
6
- <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
7
-
8
- <application>
9
- <activity
10
- android:name="io.getstream.rn.callingx.notifications.NotificationReceiverActivity"
11
- android:excludeFromRecents="true"
12
- android:exported="false"
13
- android:noHistory="true"
14
- android:taskAffinity=""
15
- android:theme="@android:style/Theme.Translucent.NoTitleBar" />
16
-
17
- <service
18
- android:name="io.getstream.rn.callingx.notifications.NotificationReceiverService"
19
- android:exported="false" />
20
-
21
- <service
22
- android:name="io.getstream.rn.callingx.CallService"
23
- android:enabled="true"
24
- android:exported="false"
25
- android:foregroundServiceType="phoneCall"
26
- android:stopWithTask="true" />
27
-
28
- </application>
29
- </manifest>
@@ -1,104 +0,0 @@
1
- package io.getstream.rn.callingx.notifications
2
-
3
- import android.content.Context
4
- import android.os.Build
5
- import androidx.core.app.NotificationChannelCompat
6
- import androidx.core.app.NotificationManagerCompat
7
- import io.getstream.rn.callingx.debugLog
8
-
9
- class NotificationChannelsManager(
10
- private val context: Context,
11
- private val notificationManager: NotificationManagerCompat =
12
- NotificationManagerCompat.from(context)
13
- ) {
14
-
15
- private var notificationsConfig: NotificationsConfig.Channels? = null
16
-
17
- companion object {
18
- private const val TAG = "[Callingx] NotificationChannelsManager"
19
- }
20
-
21
- data class NotificationStatus(
22
- val canPost: Boolean,
23
- val hasPermissions: Boolean,
24
- val areNotificationsEnabled: Boolean,
25
- val isIncomingChannelEnabled: Boolean,
26
- val isOngoingChannelEnabled: Boolean,
27
- )
28
-
29
- fun setNotificationsConfig(notificationsConfig: NotificationsConfig.Channels) {
30
- this.notificationsConfig = notificationsConfig
31
- }
32
-
33
- fun createNotificationChannels() {
34
- notificationsConfig?.let {
35
- val incomingChannel = createNotificationChannel(it.incomingChannel)
36
- val ongoingChannel = createNotificationChannel(it.ongoingChannel)
37
-
38
- notificationManager.createNotificationChannelsCompat(
39
- listOf(
40
- incomingChannel,
41
- ongoingChannel,
42
- ),
43
- )
44
- debugLog(TAG, "createNotificationChannels: Notification channels registered")
45
- }
46
- }
47
-
48
- fun getNotificationStatus(): NotificationStatus {
49
- val areNotificationsEnabled = areNotificationsEnabled()
50
- val hasPermissions = hasNotificationPermissions()
51
- val isIncomingChannelEnabled = isChannelEnabled(notificationsConfig?.incomingChannel?.id)
52
- val isOngoingChannelEnabled = isChannelEnabled(notificationsConfig?.ongoingChannel?.id)
53
-
54
- val canPost =
55
- areNotificationsEnabled &&
56
- hasPermissions &&
57
- isIncomingChannelEnabled &&
58
- isOngoingChannelEnabled
59
-
60
- return NotificationStatus(
61
- canPost,
62
- hasPermissions,
63
- areNotificationsEnabled,
64
- isIncomingChannelEnabled,
65
- isOngoingChannelEnabled
66
- )
67
- }
68
-
69
- private fun createNotificationChannel(
70
- config: NotificationsConfig.ChannelParams
71
- ): NotificationChannelCompat {
72
- return NotificationChannelCompat.Builder(config.id, config.importance)
73
- .apply {
74
- setName(config.name)
75
- setVibrationEnabled(config.vibration)
76
- setSound(null, null)
77
- }
78
- .build()
79
- }
80
-
81
- private fun areNotificationsEnabled(): Boolean {
82
- return notificationManager.areNotificationsEnabled()
83
- }
84
-
85
- private fun hasNotificationPermissions(): Boolean {
86
- // CallStyle notifications are exempt from POST_NOTIFICATIONS on Android 13+
87
- // when the app self-manages phone calls (MANAGE_OWN_CALLS + ConnectionService).
88
- // This package uses that path, so we always allow posting call notifications.
89
- return true
90
- }
91
-
92
- private fun isChannelEnabled(channelId: String?): Boolean {
93
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
94
- return true
95
- }
96
-
97
- if (channelId == null) {
98
- return false
99
- }
100
-
101
- val channel = notificationManager.getNotificationChannel(channelId)
102
- return channel != null && channel.importance != NotificationManagerCompat.IMPORTANCE_NONE
103
- }
104
- }