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

Problem on device with Asus call manager like on Zen Phone #36

Closed andrewvmail closed 6 years ago

andrewvmail commented 6 years ago

On some Zen phone the UI is managed by Asus call manager (some third party dialer) and it causes issue with audio handling with Webrtc. I could get it to work with a delay of 10 seconds to get the audio started. The first call seem to work instant but subsequent seems to need that delay. I dont know what that Asus call manager thing does but it does some weird stuff, like your able to record the audio and stuff.

Anyone seeing this on these devices? or its just me?

Also interesting comment i found and the thread have some good ideas, will attempt to do a PR in the future if someone does not beat me to it https://github.com/twilio/voice-quickstart-android/issues/95

andrewvmail commented 6 years ago

Hmm actually I don't think there is a need for any PR now. I think the bug is with Asus call manager if anything. I discovered a way to get WhatsApp, Viber like behaviour using https://github.com/katzer/cordova-plugin-background-mode

cordova.plugins.backgroundMode.wakeUp();
// Turn screen on and show app even locked
cordova.plugins.backgroundMode.unlock();
// will take the app into foreground

// back to background when done calling
// or potential security hole because app is active without unlocking?
cordova.plugins.backgroundMode.moveToBackground();

So one can just detect those Asus builds using device.model and skip CordovaCall in those cases.

Some interesting tidbits I find after playing around with Viber their actual incoming call screen when the device is locked is the same activity window, not a separate one (for some reason i thought this was separate at first because i know in Android you can have two activities)

D-Marc1 commented 6 years ago

It's tough to say why that issue is happening without a device to test. But using a custom calling screen is a good solution for now.

felipedeaguiar commented 3 years ago

I have the same problem, and I don't know where to start. I would like the call to be similar to whatsapp, does anyone have any suggestions where to start?