Mac: How to start iPhone call from Servoy

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Mac: How to start iPhone call from Servoy

Postby LXS » Tue Jan 09, 2018 3:15 pm

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
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: Mac: How to start iPhone call from Servoy

Postby LXS » Tue Jan 09, 2018 4:54 pm

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.
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: Mac: How to start iPhone call from Servoy

Postby swingman » Wed Jan 10, 2018 11:44 pm

Nice!
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 14 guests