distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

Send SMS with Extension Message #268

Closed Alainzz closed 9 years ago

Alainzz commented 9 years ago

Hello,

About the extension Message we have in the documentation a possibility to send a SMS message but I dont see any exemple. In the documentation we have only exemple for send a mail.

I have found this code but I have an error during the compilation in these tree lines sms.address = "01010101101"; // Error address not defined why ? sms.message = "Testing Message ANE"; // Error message not defined why ?
Message.service.sendSMS( sms ); // 1067: Contrainte implicite d'une valeur du type SMS vers un type sans rapport com.distriqt.extension.message.objects:SMS

protected function int(event:FlexEvent):void
Message.init( DEV_KEY ); var sms:SMS = new SMS(); Message( "Message Supported: " + Message.isSupported ); Message( "Message Version: " + Message.service.version ); Message( "Message Mail Supported: " + Message.isMailSupported ); if (Message.isSMSSupported) { Message( " === SENDING SMS === " ); sms.address = "01010101101"; sms.message = "Testing Message ANE"; Message.service.sendSMS( sms ); } }

Could you give me an exemple or tell me where is the error ? please.

Thank you for your help Best regards

marchbold commented 9 years ago

Hi,

Do you have another class called SMS in your project? You might be having a class conflict. Try with the full definition:

var sms:com.distriqt.extension.message.objects.SMS = new com.distriqt.extension.message.objects.SMS();
sms.address = "0444444444"; // The destination phone number
sms.message = "SMS Message from actionscript"; // The message to send

Message.service.sendSMS( sms );

Please note that the sendSMS function is only available on Android (you'll also need the manifest additions in the link below). On iOS you should us the sendSMSWithUI function.

You'll find documentation here: http://docs.airnativeextensions.com/message/docs/com/distriqt/extension/message/Message.html

Cheers

Alainzz commented 9 years ago

Thank You Michael You are right my program name was SMS 😉 I rename its its ok now.

I need only for Android.

-----Message d'origine----- De : "Michael" notifications@github.com Envoyé : ‎04/‎11/‎2014 00:26 À : "distriqt/airnativeextensions" airnativeextensions@noreply.github.com Cc : "Alainzz" alain2003fr@yahoo.fr Objet : Re: [airnativeextensions] Send SMS with Extension Message (#268)

Hi, Do you have another class called SMS in your project? You might be having a class conflict. Try with the full definition: var sms: com.distriqt.extension.message.objects.SMS = new com.distriqt.extension.message.objects.SMS(); sms.address = "0444444444"; // The destination phone number sms.message = "SMS Message from actionscript"; // The message to send

Message.service.sendSMS( sms ); Please note that the sendSMS function is only available on Android (you'll also need the manifest additions in the link below). On iOS you should us the sendSMSWithUI function. You'll find documentation here: http://docs.airnativeextensions.com/message/docs/com/distriqt/extension/message/Message.html Cheers — Reply to this email directly or view it on GitHub.=

marchbold commented 9 years ago

Good to hear! Good luck with your app