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

DisplayIncomingCall UI is not working in Android.

Open pavanMude opened this issue 4 years ago • 8 comments

Bug report

  • [ ] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [ ] Android

  • [ ] iOS

Description

I have integrated RNCallKeep as per the guidance specified in repo, It looks strange that it is able to show displayIncomingCallUI on iOS, however it seems to be not working in android. it seems so strange that the code is similar which means, when we replicate the code as per the demo, it should work irrespective of the platforms. How come it won't work for android, even after following setup instructions and demo example. Can anyone help me where I am committing a mistake.

Steps to Reproduce

Code

const options = {
      ios: {
        appName: "Sovereign Wallet",
      },
      android: {
        alertTitle: "Permissions required",
        alertDescription: "This application needs to access your phone accounts",
        cancelButton: "Cancel",
        okButton: "ok",
        additionalPermissions: [PermissionsAndroid.PERMISSIONS.READ_CONTACTS]
      },
    };

    try {
      RNCallKeep.setup(options);
      RNCallKeep.setAvailable(true); // Only used for Android, see doc above.
    } catch (err) {
      console.error('initializeCallKeep error:', err.message);
    }

    RNCallKeep.addEventListener('answerCall', this.onAnswerCallAction);
    RNCallKeep.addEventListener('endCall', this.onEndCallAction);

Displaying like this when on a push notification RNCallKeep.displayIncomingCall(this.getCurrentCallId(), "XX Name", 749nsusd7b, "",true);

Versions

- Callkeep: 3.0.12
- React Native: 0.59.9
- iOS: 
- Android: android 7.1.1
- Phone model: Samsung A51, oppo 

Logs

Paste here

pavanMude avatar Jun 19 '20 17:06 pavanMude

Same for me - Not working in Android. Haven't checked it in iOS. Can someone please look into this?

georgetk avatar Jul 16 '20 13:07 georgetk

Hi, I solved it be adding this line in my Manifest https://github.com/wazo-platform/wazo-react-native-demo/blob/16d7795a6a519507fc6798ce5cdc17026d2a162b/android/app/src/main/AndroidManifest.xml#L27

georgetk avatar Jul 17 '20 06:07 georgetk

are you able to see call account permission popup ?

HarshitPadalia avatar Sep 09 '20 07:09 HarshitPadalia

In my case, after following the example and getting it not working, I added this permission and the UI started working. The first time it asks you to add your app to your phone account and after that it will works pretty well.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />

My emulator (API 30) works and displays a fake call but I have a problem when using my real device. I use HTC Honor 8.

I thought it was a problem of permissions so I added them (https://github.com/react-native-webrtc/react-native-callkeep/issues/222#issuecomment-659887926 and https://github.com/react-native-webrtc/react-native-callkeep/issues/222#issuecomment-702654239). But it still doesn't work.

When the app starts on a real device then it asks for Phone and Microphone permissions. So I grant them. And then it asks for the permission to access phone calls via "cancel+ok" dialog. I can't choose to enable it because the settings screen flashes for a brief moment and then disappears. I tried to find the setting in the phone settings but there is no setting for "Calling accounts" on my device (this is how it's called on my emulator).

My device uses Android 7.0, which is API level 24. I'd find this a decently recent device which should work. Or is it that it's a development setting that only works on emulators?

Is this the expected behavior for all physical devices or all devices who have this API level?

Invertisment avatar Mar 06 '21 08:03 Invertisment

Hello guys, I am facing this issue as well. I am not able to get the incoming call UI in android. RNCallKeep.displayIncomingCall() I am using this above line to show the incoming call ui but it's not working in android but working fine in iOS. Please help me out in this issue. Thanks!

usamaabutt avatar Jun 21 '21 06:06 usamaabutt

any news about this?

timorss avatar Jul 06 '21 06:07 timorss

Hello guys, I am facing this issue as well. I am not able to get the incoming call UI in android. RNCallKeep.displayIncomingCall() I am using this above line to show the incoming call ui but it's not working in android but working fine in iOS. Please help me out in this issue. Thanks!

I face the same, any solutions today?

iita71737 avatar Nov 10 '23 09:11 iita71737