react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
924 stars 445 forks source link

displayIncoming Call Not Working, hasPhoneAccount returns false. #425

Open aagam29 opened 3 years ago

aagam29 commented 3 years ago

Bug report

We cloned the sample app as well and ran it without any changes, but the options display incoming call & display incoming call in 3 seconds none showed the native call UI!

Description

We want to build a calling functionality and we were trying out this library. For a POC, We made a fresh react-native app,

Installed the react-native-call-keep library as per the instructions given here. Tried manual and auto-linking both.

The method displayIncomingCall() does not display anything.

We called the RNCallKeep.setup() function
And then called the RNCallKeep.displayIncomingCall() with proper parameters.

Expected Behaviour: Incoming Call to be shown Actual Behaviour: Could not see anything.

We kept logs and debugged inside the node_modules as well to see what is going wrong. Inside node_modules, In the file RNCallKeepModule.java

The method hasPhoneAccount() was returning false due to which the code is returning without doing anything.

We tried to debug further inside the method and make it return true somehow but It did not work out

The root cause code inside hasPhoneAccount() call that is returning false is telecomManager.getPhoneAccount(handle).isEnabled().

During the setup call, we've checked the registering Phone Account function as well but it runs well.

We've tried on emulators and real android devices as well.

Not sure what is the issue.

RNCallKeep.hasPhoneAccount() keeps returning false due to which no incoming call display is shown.

Steps to Reproduce

Here is the reproduction repository. just clone, do npm install, npm run start & npm run android and you shall be good to go.

Versions

- Callkeep:4.2.0
- React Native:0.64.1
- iOS: Not tested yet on IOS
- Android: 9, 10
- Phone model: 9 - Redmi Note 7 Pro, 10 - Emulator 

Thanks in advance :)

namnm commented 3 years ago

@aagam29 Have you tried with any other device like a Samsung device? Did you check the setup() if it has any error? In the first time we call setup, it should open a settings view for us to click on allow permission

dezse97 commented 1 year ago

Hello. How did you manage to solve this issue? I am facing the same problem on some of the Lenovo android tablets.