Page 1 of 1

Mac: How to start iPhone call from Servoy

PostPosted: Tue Jan 09, 2018 3:15 pm
by LXS
Hi,

on Mac OS X you can click on a simple link and the OS asks if it should start a call via the iPhone connection.
A sample HTML Code is here:

Code: Select all
<html>
<head><title>PhoneCallTest</title></head>
<body>
<a href="tel:030-123456">Call</a>
</body>
</html>


Is it possible to trigger this call directly from Servoy?

I've tried it with application.showURL('tel:030-123456'), but the method return false and nothing happens.

Is there another way to call the "tel" scheme?

Thanks!
Alex

Re: Mac: How to start iPhone call from Servoy

PostPosted: Tue Jan 09, 2018 4:54 pm
by LXS
I think i found a simple solution:

if (utils.stringMiddle(application.getOSName(), 1, 7) == 'Windows') {
application.executeProgram("explorer",["tel:" + phoneNumber])
} else if (utils.stringMiddle(application.getOSName(), 1, 3) == 'Mac') {
application.executeProgram("open",["tel:" + phoneNumber])
}


On Windows you get a dialog to choose the application.
On Mac you get a small popup in the right upper corner, like when you click on the HTML link in the first post.

Re: Mac: How to start iPhone call from Servoy

PostPosted: Wed Jan 10, 2018 11:44 pm
by swingman
Nice!