I'm working on an application that has to call a number in certain cases (for domotic purposes). The number dialing must be transparent for the user, so the dialer screen must not be shown and the call start automatically.
I'm using this syntax: document.location.href = 'tel: xxxxxxxxxxxx'. Is there a way to bypass the dialer screen?
Thank you, Diego,
I see this parameter in the documentation
boolean; true if you always wish to bypass the app chooser if user has multiple applications installed that can handle calls
In your opinion, should it do what I need?
Seems that you neet to set the parameter to true to avoid the app offering options to select which app will dial the number. I supose that in that case will go to device phone dialing.
Sorry, I didn't use this plugin, I was aware of it because a search I did some time ago.
Antonio -- you cannot bypass the dialing screen due to restrictions in Android (and iOS and other systems). This has nothing to do with the XDK and it is not something we can control. For security reasons, only "trusted apps" are allowed to initiate a phone call or an SMS, etc. If you have a "rooted" device you can get around that restriction, but it is not what you should expect of a typical user's device (to be rooted).
Another question: I found a Cordova Plugin (for Phonegap) that should
"enable PhoneGap apps on the iPhone and Android platforms to dial a phone number without requireing additional user interaction (such as the 'Call / Cancel' popup that ordinarilly would occur when using window.location.href = "tel:2125551212"".
here's the URL web page:
What do you thinka about that? Could it work? With XDK?
Antonio -- you can certainly give it a try. The XDK creates standard Cordova apps, so Cordova and PhoneGap plugins will work with the XDK, unless they include gradle scripts or hooks (which we hope to fix in a future build system release). That plugin is quite old (by Cordova standards) so it may or may not work (not because of the XDK but because of changes in Cordova in the past two years). Certainly worth trying out to see if it works. I suspect it will bring up the dialing screen with the number filled in, but the user will likely still have to push the "dial" button.
Antonio -- note that this may not work on all phones and all versions of Android. See these doc pages: