Search code examples
actionscript-3adobeair-native-extension

In-app sms sending in as3


How to send sms within an iphone and android app using as3. I found this code while googling:

var callURL:String="sms:0-123-456-7890";
var targetURL:URLRequest = new URLRequest(callURL);
navigateToURL(targetURL);

Its working, but it is navigating the app to sms window controller. Can it be done without opening the sms controller window. Is there anything that opens a window within the app itself. Is there any air native extenson which perform this for android and iphone?


Solution

  • Yeah, using navigateToURL is going to pop you over to the phones default SMS app. To get around this you're going to need to use a native extension.

    I know of one for Android:

    https://github.com/mr-archano/Android-AIR-Extensions

    If you have an Android phone you can check out a demo of this ANE inside of the AIRexplorer app. Select the SMS ANE version from the list (the app includes an extension as well as navigateToURL)

    I don't know of one for iOS right now so you may have to do a little bit of digging

    Oh Also, wanted to add a comment because I'm not really sure of your intent here.

    If your goal is to send a sms without any user interaction that is not going to be possible. ANE or not