react-native-webrtc / react-native-webrtc/react-native-callkeep
Android native calling UI onAnswer: Calling JS function after bridge has been destroyed
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 511
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 2
Description
Bug report
-
I've checked the example to reproduce the issue.
-
Reproduced on:
-
Android
-
iOS
Description
This occurs only when my app is killed and the device / keyguard is locked. When swiping up to answer a call from the native calling UI in Android and calling my own native module inside the answerCall event listener which unlocks the device I am seeing a log in logcat:
ReactNative: Calling JS function after bridge has been destroyed: RCTDeviceEventEmitter.emit(["RNCallKeepPerformAnswerCallAction",{"callUUID":"d2a035dc-3bcc-4ece-a509-e93a8bc62ab3"}])
The Native UI will not dismiss if I answer, it only dismisses when I decline the call.
In my Headless JS function I am calling:
RNCallKeep.registerPhoneAccount(...)
RNCallKeep.displayIncomingCall(...)
RNCallKeep.setForegroundServiceSettings(...)
RNCallKeep.registerAndroidEvents(...)
RNCallKeep.addEventListener('answerCall', () => {...})
On calling registerPhoneAccount() I am also seeing the below exception being thrown.
Any ideas on why I'm seeing these issues are greatly appreciated!
Versions
- Callkeep: 4.2.0
- React Native: 0.63.3
- iOS:
- Android: 11
- Phone model: physical Pixel 2XL
Logs
2021-07-03 16:13:32.874 29401-29470/com.xyz E/unknown:ReactNative: CatalystInstanceImpl caught native exception
java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.facebook.react.bridge.ReadableMap.hasKey(java.lang.String)' on a null object reference
at io.wazo.callkeep.RNCallKeepModule.isSelfManaged(RNCallKeepModule.java:120)
at io.wazo.callkeep.RNCallKeepModule.registerPhoneAccount(RNCallKeepModule.java:630)
at io.wazo.callkeep.RNCallKeepModule.registerPhoneAccount(RNCallKeepModule.java:166)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:223)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
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 RNCallKeepModule.java at isSelfManaged (line 120) and registerPhoneAccount (line 630), then trace the answerCall event path and the bridge lifecycle described in the log. Reproduce the killed-app, locked-device answer flow and verify that registration no longer throws a null-map exception and that the native calling UI dismisses after answering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100