The previous recipe explained how you can call a number from your applications. This recipe will show you how to send an SMS to a selected number. For simplicity we're going to use the same approach. We'll develop a simple XHTML file displaying a list with different contacts. When the user clicks on one of the contacts the iPhone will display the screen for sending an SMS.
As in the previous recipe we will use the iWebKit framework. As both recipes are similar, we're going to use the same XHTML file developed for the previous recipe.
1. Open the
call.html
file and replace the content of thehref
attribute of each<li>
item for a new string starting withsms:
instead oftel
. For example, the first item will be the following:<li> <a class="noeffect" href="sms:555-666-777"> <span class="name">Aaron Stone</span> </a> </li>
2. Save the new content of the original file as a new file called
sms.html...