react-native-callkeep
react-native-callkeep copied to clipboard
CallKeep UI not showing in terminate state
Bug report
- Reproduced on:
- Android 12
Description
I'm using react native in my application, i want to display callkeep UI when my application is in terminate state. so i'm using FCM notificaiton to display callkeep ui in terminate state. In Android callkeep UI showing in foreground state but not in terminate state. i'm initializing callkeep inside setBackgroundMessageHandler method of FCM.
i have initialise callkeep like below: RNCallKeep.setup({ ios: { appName: 'CallKeepDemo', }, android: { alertTitle: 'Permissions required', alertDescription: 'This application needs to access your phone accounts', cancelButton: 'Cancel', okButton: 'ok', foregroundService: { channelId: 'com.app.demo', channelName: 'Foreground service for my app', notificationTitle: 'My app is running on background', notificationIcon: 'Path to the resource icon of the notification', }, } }).then((accepted) => { console.log("accepted", accepted) }); RNCallKeep.setAvailable(true);
and then register all callback methods of callkeep and then use displayIncomingCall() to display callkeep UI but i'm getting below error
[RNCallKeepModule] checkPhoneAccountPermission error Activity doesn't exist [RNCallKeepModule] displayIncomingCall ignored due to no ConnectionService or no phone account
and it will not display callkeep UI.
Versions
- Callkeep: ^4.3.3
- React Native: 0.68.2
- Android: 12
- Phone model: Redmi 9A
Logs
[RNCallKeepModule] checkPhoneAccountPermission error Activity doesn't exist [RNCallKeepModule] displayIncomingCall ignored due to no ConnectionService or no phone account
Also getting this
any solution?
You should use Pushkit to wake your app
@youcefbouchemat PushKit is only for iOS waking,this issue is not regarding that. Problem here is that Activity doesn't get started when App is terminated so the checkPhoneAccountPermission function will always yield an error.
@hirensakhiya follow this link to resolve issue of activity not found https://github.com/react-native-webrtc/react-native-callkeep/pull/576/files