Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The URLRequest class can be used to open the Messages application to send text messages. By prepending the request with sms:, iOS will launch the Messages application when the navigateToURL method is called. Figure 6-2 shows the sample application running and Figure 6-3 shows the Messages application with the phone number prepopulated. Unfortunately, at this time it is not possible to send a message along with the phone number when opening the Messages application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
protected function sendIt_clickHandler(event:MouseEvent):void
{
var s:String = "";
s += "sms:";
s+= sendTo.text;
navigateToURL(new URLRequest(s));
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label text="Send To" top="40" left="50"/>
<s:TextInput id="sendTo" top="30" left="110" text="2125559999" width="200"/>
<s:Button id="sendIt" label="Send" click="sendIt_clickHandler(event)" top="110" left="110"/>
</s:Application>