@stream-io/react-native-callingx 0.1.0-beta.4 → 0.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/android/build.gradle +9 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallService.kt +69 -45
- package/android/src/main/java/io/getstream/rn/callingx/CallingxEventEmitterAdapter.kt +7 -0
- package/android/src/main/java/io/getstream/rn/callingx/{CallingxModule.kt → CallingxModuleImpl.kt} +194 -103
- package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +9 -9
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +8 -8
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +7 -7
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +7 -7
- package/android/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +3 -0
- package/android/src/newarch/java/io/getstream/rn/callingx/CallingxModule.kt +148 -0
- package/android/src/oldarch/java/io/getstream/rn/callingx/CallingxModule.kt +177 -0
- package/android/src/oldarch/java/io/getstream/rn/callingx/CallingxPackage.kt +16 -0
- package/dist/module/CallingxModule.js +2 -2
- package/dist/module/CallingxModule.js.map +1 -1
- package/dist/module/EventManager.js +11 -4
- package/dist/module/EventManager.js.map +1 -1
- package/dist/module/spec/NativeCallingx.js +4 -2
- package/dist/module/spec/NativeCallingx.js.map +1 -1
- package/dist/module/utils/utils.js +3 -0
- package/dist/module/utils/utils.js.map +1 -1
- package/dist/typescript/src/CallingxModule.d.ts +1 -1
- package/dist/typescript/src/CallingxModule.d.ts.map +1 -1
- package/dist/typescript/src/EventManager.d.ts.map +1 -1
- package/dist/typescript/src/spec/NativeCallingx.d.ts +3 -3
- package/dist/typescript/src/spec/NativeCallingx.d.ts.map +1 -1
- package/dist/typescript/src/types.d.ts +2 -2
- package/dist/typescript/src/types.d.ts.map +1 -1
- package/dist/typescript/src/utils/utils.d.ts +1 -0
- package/dist/typescript/src/utils/utils.d.ts.map +1 -1
- package/ios/Callingx.mm +326 -22
- package/ios/CallingxCall.swift +105 -0
- package/ios/CallingxImpl.swift +136 -70
- package/ios/CallingxPublic.h +2 -5
- package/ios/UUIDStorage.swift +71 -26
- package/package.json +3 -3
- package/src/CallingxModule.ts +2 -2
- package/src/EventManager.ts +18 -5
- package/src/spec/NativeCallingx.ts +12 -3
- package/src/types.ts +2 -2
- package/src/utils/utils.ts +3 -0
- /package/android/src/{main → newarch}/java/io/getstream/rn/callingx/CallingxPackage.kt +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/react-native-callingx",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@react-native-community/cli": "20.0.1",
|
|
63
63
|
"@react-native/babel-preset": "^0.81.5",
|
|
64
|
-
"@stream-io/react-native-webrtc": "137.1.2
|
|
64
|
+
"@stream-io/react-native-webrtc": "137.1.2",
|
|
65
65
|
"@types/react": "^19.1.0",
|
|
66
66
|
"del-cli": "^6.0.0",
|
|
67
67
|
"react": "19.1.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"typescript": "^5.9.2"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@stream-io/react-native-webrtc": ">=137.1.
|
|
73
|
+
"@stream-io/react-native-webrtc": ">=137.1.2",
|
|
74
74
|
"react": "*",
|
|
75
75
|
"react-native": "*"
|
|
76
76
|
},
|
package/src/CallingxModule.ts
CHANGED
|
@@ -196,8 +196,8 @@ class CallingxModule implements ICallingxModule {
|
|
|
196
196
|
return NativeCallingModule.endCallWithReason(callId, reasons[reason]);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
return NativeCallingModule.
|
|
199
|
+
isCallTracked(callId: string): boolean {
|
|
200
|
+
return NativeCallingModule.isCallTracked(callId);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
hasRegisteredCall(): boolean {
|
package/src/EventManager.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { NativeEventEmitter, type EventSubscription } from 'react-native';
|
|
2
2
|
import NativeCallingModule from './spec/NativeCallingx';
|
|
3
3
|
import type {
|
|
4
4
|
EventData,
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
VoipEventData,
|
|
7
7
|
VoipEventName,
|
|
8
8
|
} from './types';
|
|
9
|
-
import { isVoipEvent } from './utils/utils';
|
|
9
|
+
import { isVoipEvent, isTurboModuleEnabled } from './utils/utils';
|
|
10
10
|
|
|
11
11
|
type EventListener<T> = (params: T) => void;
|
|
12
12
|
|
|
@@ -31,10 +31,23 @@ class EventManager<Name extends EventName | VoipEventName, Params> {
|
|
|
31
31
|
eventListeners.forEach((listener) => listener(event.params as Params));
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
if (
|
|
35
|
-
|
|
34
|
+
if (isTurboModuleEnabled) {
|
|
35
|
+
if (isVoipEvent(eventName)) {
|
|
36
|
+
this.subscription = NativeCallingModule.onNewVoipEvent(eventHandler);
|
|
37
|
+
} else {
|
|
38
|
+
this.subscription = NativeCallingModule.onNewEvent(eventHandler);
|
|
39
|
+
}
|
|
36
40
|
} else {
|
|
37
|
-
|
|
41
|
+
const nativeEmitter = new NativeEventEmitter(
|
|
42
|
+
NativeCallingModule as any,
|
|
43
|
+
);
|
|
44
|
+
const nativeEventName = isVoipEvent(eventName)
|
|
45
|
+
? 'onNewVoipEvent'
|
|
46
|
+
: 'onNewEvent';
|
|
47
|
+
this.subscription = nativeEmitter.addListener(
|
|
48
|
+
nativeEventName,
|
|
49
|
+
eventHandler as any,
|
|
50
|
+
);
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
53
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
TurboModuleRegistry,
|
|
3
|
+
NativeModules,
|
|
4
|
+
type TurboModule,
|
|
5
|
+
} from 'react-native';
|
|
2
6
|
|
|
3
7
|
// @ts-expect-error - CodegenTypes is not properly typed
|
|
4
8
|
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
9
|
+
import { isTurboModuleEnabled } from '../utils/utils';
|
|
5
10
|
|
|
6
11
|
export interface Spec extends TurboModule {
|
|
7
12
|
setupiOS(options: {
|
|
@@ -109,7 +114,7 @@ export interface Spec extends TurboModule {
|
|
|
109
114
|
},
|
|
110
115
|
): Promise<void>;
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
isCallTracked(callId: string): boolean;
|
|
113
118
|
|
|
114
119
|
hasRegisteredCall(): boolean;
|
|
115
120
|
|
|
@@ -173,4 +178,8 @@ export interface Spec extends TurboModule {
|
|
|
173
178
|
log(message: string, level: 'debug' | 'info' | 'warn' | 'error'): void;
|
|
174
179
|
}
|
|
175
180
|
|
|
176
|
-
|
|
181
|
+
const CallingxModule: Spec = isTurboModuleEnabled
|
|
182
|
+
? TurboModuleRegistry.getEnforcing<Spec>('Callingx')
|
|
183
|
+
: (NativeModules.Callingx as Spec);
|
|
184
|
+
|
|
185
|
+
export default CallingxModule;
|
package/src/types.ts
CHANGED
|
@@ -76,11 +76,11 @@ export interface ICallingxModule {
|
|
|
76
76
|
): Promise<void>;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* Check if the call is
|
|
79
|
+
* Check if the call is tracked in the native calling module.
|
|
80
80
|
* @param callId - The call id.
|
|
81
81
|
* @returns The boolean value.
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
isCallTracked(callId: string): boolean;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Check if there is a registered call.
|
package/src/utils/utils.ts
CHANGED
|
File without changes
|