react-native-webrtc / react-native-webrtc/react-native-callkeep
[iOS] [Bug report] isCallActive return undefined
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 511
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 2
Description
As docs in https://reactnative.dev/docs/native-modules-ios, ReactNative method always return void so to pass value to JS layer, we need to use callback, Promise or eventEmitter.
Current iOS implement. Return boolean value in this method doesn't send to JS layer
+ (BOOL)isCallActive:(NSString *)uuidString
{
CXCallObserver *callObserver = [[CXCallObserver alloc] init];
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:uuidString];
for(CXCall *call in callObserver.calls){
NSLog(@"[RNCallKeep] isCallActive %@ %d ?", call.UUID, [call.UUID isEqual:uuid]);
if([call.UUID isEqual:[[NSUUID alloc] initWithUUIDString:uuidString]] && !call.hasConnected){
return true;
}
}
return false;
}
Js index:
isCallActive = async(uuid) => await RNCallKeepModule.isCallActive(uuid);
I already tried with Promise method, it's work but not for my case.
I needed to call this method each second so I changed to event emitter to prevent "illegal callback invocation from native module" error.
PR is not available atm.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the iOS native-module implementation of isCallActive and the JS index wrapper, using the linked React Native native-modules documentation. Reproduce the current undefined result and trace how the boolean crosses the native-to-JS boundary during once-per-second calls. Done means JavaScript reliably receives the call-active boolean without the reported illegal callback invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100