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

speakerOn not working with callNumber #102

Closed justvijit closed 4 years ago

justvijit commented 4 years ago

I want my app to call an actual number and put on the call's loud speaker right after. Below is the code:

cordova.plugins.CordovaCall.callNumber('NUMBERHERE',function(){ cordova.plugins.CordovaCall.speakerOn(function(){ console.log('Speaker On'); },function(){ console.log('Cant start speaker'); }); }, function(){ console.log('Cant make call'); });

The call gets dialled and connected, but the speaker never gets on. I even get "Speaker On" in console. but its not actually on. I tried putting a settimeout after callNumber callback and called speakerOn after 3 seconds. Same result.

What am I missing?

D-Marc1 commented 4 years ago

This plugin only really deals with CallKit and Connection Service, which are essentially merely native UI components to interact with. The callNumber function was added after for convenience, as it is call related and simple enough to implement. But ultimately, it's basically the same clicking on a phone number link on your phone to call someone. This plugin has no control over actual phone calls.

justvijit commented 4 years ago

Hi, Thanks for super fast reply. But the thing is, right after I posted, I rechecked just to realize that the speaker did get on, it wasnt just displaying it as 'on'. So, when I picked up the call (I dialled on my other phone and received it), I realized that the speaker was indeed on. Not sure now that you said it does not have control over actual phone call, but in my case it worked. Due you have idea as to on what phone it may or may not working. I am doing my testing on an android phone, Motorola, with Android 8 something.