Rohan
Rohan

Reputation: 3

how to send SMS in Flash Air for Android

I am trying build an sms based application in AIR (Flash) Got this code from an old link

str = "sms:1-415-555-1212"; 
var urlReq:URLReq = new URLRequest(str); 
navigateToURL(urlReq);

but this one is 5 years old and lot has change and even Flash is now Animate CC so can anyone help me in this

Upvotes: 0

Views: 63

Answers (1)

Koby Douek
Koby Douek

Reputation: 16675

5 years, but still nothing changed - your code will work on modern devices.

You can use the URL with sms: - This is supported in all mobile OS:

private function sendSMS(phone:string):void
{
    navigateToURL(new URLRequest("sms:" + phone));   
}

For example:

navigateToURL(new URLRequest("sms:+00133234534"));

Bonus Tip!

Send a phone call: navigateToURL(new URLRequest("tel:" + phone));

Send an email: navigateToURL(new URLRequest("mailto:" + email));

Upvotes: 1

Related Questions