On occasions you may want your app to provide functionality that is already available from iOS's system applications. To guarantee a consistent and familiar experience, it is possible to launch certain system apps rather than performing the task internally within your own. To enable this, iOS supports various URI schemes which can be used to launch a specific application.
In this recipe, you will learn how to use the mailto
URI scheme to open and send e-mail from the Mail application.
From the book's accompanying code bundle, load chapter13\recipe6\recipe.fla
into Flash Professional and use it as a starting point.
Sitting on its stage is a button with an instance name of mailBtn
. When pressed, it will launch the device's Mail application and pre-populate an e-mail for the user to send.
Let us write the ActionScript required to make this happen.