Community
cancel
Showing results for 
Search instead for 
Did you mean: 
A_B_3
Beginner
62 Views

How to realize phone call now?

In older XDK releases I used such JS code:

var phonenumber = "+71234567890";
window.location.href = "tel:" + phonenumber;

and it worked perfect.
Now It is not work. How to realize phone call now? (I build only IOS version)

Tags (2)
0 Kudos
3 Replies
Nicolas_O_Intel
Employee
62 Views

Hello A.B

Here is a nice article about how to make phone call from the Ionic Forums https://forum.ionicframework.com/t/making-phone-call-from-app-href-tel-123/1968/13

It show some Ionic specific code there, but it should work with standard HTML code as well. 

PaulF_IntelCorp
Employee
62 Views

Probably needs some whitelist rules, see this doc page > https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk

A_B_3
Beginner
62 Views

Yes! I did it.
Thanks for your links.

 

For dummies like me - do these actions:

1. In index.html add:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' data: blob: filesystem: ws: gap: file: cdvfile: https://ssl.gstatic.com *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; child-src *; ">

 

 2. In Project tab - Build settings - Whitelist add: tel:* in Intent (<allow-intent>) and in Navigation (<allow-navigation>)
 

Reply