WebsiteBeaver / CordovaCall

Cordova CallKit & ConnectionService plugin for iOS/Android that displays the native call UI for VOIP apps
MIT License
196 stars 91 forks source link

Answer not working in Android 11 #112

Open mozhn opened 3 years ago

mozhn commented 3 years ago

Answer function does not work on android 11.

Listener does not get called.

cordova.plugins.CordovaCall.on('answer', () => {
  // code
});

Device info:

Android OS: 11
Phone model: Xiaomi Mi Note 10 Lite
mozhn commented 3 years ago

I think this is a general problem.

same device and problem: https://github.com/react-native-webrtc/react-native-callkeep/issues/341

Qvadis commented 3 years ago

I'm facing the same issue in two devices:

What I found is that the onAnswer method overwritten in MyConnectionService is never called. The onReject it is called as usual.

In the Pocophone, I saw a trace that may lead us somewhere:

android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package com.google.android.dialer, crashing app(uid=10177, pid=22614): Couldn't inflate contentViewsjava.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Notification$MessagingStyle android.app.Notification$MessagingStyle.setConversationType(int)' on a null object reference at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7876) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

I'll keep investigating, any help would be appreciated.

Cheers, Borja.

mozhn commented 3 years ago

I'm facing the same issue in two devices:

  • Oppo Find X2 Lite
  • Pocophone F2

What I found is that the onAnswer method overwritten in MyConnectionService is never called. The onReject it is called as usual.

In the Pocophone, I saw a trace that may lead us somewhere:

android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package com.google.android.dialer, crashing app(uid=10177, pid=22614): Couldn't inflate contentViewsjava.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Notification$MessagingStyle android.app.Notification$MessagingStyle.setConversationType(int)' on a null object reference at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7876) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

I'll keep investigating, any help would be appreciated.

Cheers, Borja.

Hello, is there any improvement on the subject?

mozhn commented 3 years ago

There is a new improvement.

https://github.com/react-native-webrtc/react-native-callkeep/pull/420

haythamforever commented 2 years ago

any fix so far ?

gss-karthik commented 2 years ago

Couldn't be able to click ANSWER when I get a call.

cordova.plugins.CordovaCall.on('answer', (answerData) => { console.log("Answered"); }); I could see the issue in OPPO F19s ColorOS v11.1 Android 11 and POCO m3 pro .

Working In samsung phones.

Qvadis commented 2 years ago

Apparently, it is fixed in devices with Android 12 OS (tested it with POCO F2 PRO)