Skip to content

Instantly share code, notes, and snippets.

@LearningTitanium
Created February 13, 2012 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LearningTitanium/1814562 to your computer and use it in GitHub Desktop.
Save LearningTitanium/1814562 to your computer and use it in GitHub Desktop.
BenCoding Titanium SMS Module
//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