Created
February 13, 2012 07:14
-
-
Save LearningTitanium/1814562 to your computer and use it in GitHub Desktop.
BenCoding Titanium SMS Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create SMSDialog object | |
var sms = require('bencoding.sms').createSMSDialog({ barColor:'#336699' }); | |
Ti.API.info("Is This Feature Supported? => " + sms.canSendText); | |
//This is an example of how to check if the device can send Text Messages | |
if(!sms.canSendText){ | |
var noSupport = Ti.UI.createAlertDialog({ | |
title:'Not Supported', | |
message:"This device doesn't support sending text messages" | |
}).show(); | |
return; | |
}else{ | |
//Set the SMS message, you can also do this when you create the SMSDialog | |
sms.setMessageBody("Appcelerator Titanium Rocks!"); | |
//Set the SMS ToRecipients you can also do this when you create the SMSDialog | |
//This is an array so you can pass in several numbers for the message | |
sms.setToRecipients(["555-555-1234","444-444-1234"]); | |
//This call opens the SMS Message Dialog | |
sms.open({ | |
animated:true //Animated on open (OPTIONAL) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment