react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
897 stars 437 forks source link

CallKeep UI not showing in terminate state #588

Open hirensakhiya opened 2 years ago

hirensakhiya commented 2 years ago

Bug report

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

frozencap commented 1 year ago

Also getting this

fukemy commented 1 year ago

any solution?

youcefbouchemat commented 1 year ago

You should use Pushkit to wake your app

HalilFocic commented 1 year ago

@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.

afnan-myant commented 1 year ago

@hirensakhiya follow this link to resolve issue of activity not found https://github.com/react-native-webrtc/react-native-callkeep/pull/576/files