react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

CallKeep UI not showing in terminate state

Open hirensakhiya opened this issue 2 years ago • 2 comments

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

hirensakhiya avatar Jun 13 '22 10:06 hirensakhiya

Also getting this

frozencap avatar Sep 03 '22 14:09 frozencap

any solution?

fukemy avatar Sep 08 '22 09:09 fukemy

You should use Pushkit to wake your app

youcefbouchemat avatar Nov 03 '22 12:11 youcefbouchemat

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

HalilFocic avatar Nov 14 '22 13:11 HalilFocic

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

afnan-myant avatar Jan 19 '23 11:01 afnan-myant