Links or buttons that open the mobile device's phone, email, or SMS-text application are easy to create. The traditional mailto: link works fine on phones, while tel: and sms: generate calls and texts, respectively:
|Phone Call||<a href="tel:1-123-456-7890">Call 123-456-7890</a>|
|<a href="mailto:email@example.com">Email firstname.lastname@example.org</a>|
|Text Message||<a href="sms:1234567890">SMS 123-456-7890</a>|
Apple recommends the format 1-xxx-xxx-xxxx for US-based phone numbers.
In this quick example, we add "contact us" information for a page on the Nan & Bob's site, helpfully presented to users as three buttons - one each for calling, emailing, and texting:
Open IntegrationPhone/Demos/callemailtext.html to view the code and test the page on a mobile device. Note that the "call" and "text" links won't work on an iOS simulator.
We present each link as a button (with class
tel: for the phone button,
mailto: for the email button, and
sms: for the text button.