Sms Appcelerator钛-发送短信
我正在使用appcelerator titanium创建一个移动(iphone/android)应用程序。我是否可以通过appcelerator titanium让应用程序向任何给定号码发送短信?appcelerator有一组模块,如果您是其合作伙伴计划的成员,您可以使用这些模块。它包括一个SMS模块:Sms Appcelerator钛-发送短信,sms,titanium,send,appcelerator,appcelerator-mobile,Sms,Titanium,Send,Appcelerator,Appcelerator Mobile,我正在使用appcelerator titanium创建一个移动(iphone/android)应用程序。我是否可以通过appcelerator titanium让应用程序向任何给定号码发送短信?appcelerator有一组模块,如果您是其合作伙伴计划的成员,您可以使用这些模块。它包括一个SMS模块: 如果您不想付费,这里有一个iOS短信模块: 你需要遵循他的指导,但你应该能够让它发挥作用。对于android,您只需调用带有“sms://”+电话号码或类似内容的URL即可。这里有几个钛模块:
如果您不想付费,这里有一个iOS短信模块:
你需要遵循他的指导,但你应该能够让它发挥作用。对于android,您只需调用带有“sms://”+电话号码或类似内容的URL即可。这里有几个钛模块:这是一个很好的模块 只支持Android。将自动发送短信,无需usr交互
在谷歌搜索其他内容时发现了您的问题。所以我想如果将来有人遇到这个问题,我会回答的
Appcelerator Marketplace中有一个模块用于发送SMS消息:有一个功能可用于发送SMS:
var SMS_SENT = -1,
SMS_NOT_SENT = 0;
/**
* Open an SMS dialog with the given message.
* If the SMS is sent, run the onSuccess callback.
*
* @message {text} the text you want to send
* @callback {function} the funciton you want to run on success
**/
function openSmsDialog(message, onSuccess) {
if (Ti.Platform.osname === 'android') {
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_VIEW,
type: 'vnd.android-dir/mms-sms'
});
intent.putExtra('sms_body', message);
var _onClose = function(activityResult) {
if (activityResult.resultCode === SMS_SENT && onSuccess) {
onSuccess();
}
};
Ti.Android.currentActivity.startActivityForResult(intent, _onClose);
} else {
var smsModule = require("com.omorandi");
var smsDialog = smsModule.createSMSDialog({
messageBody: message
});
if (onSuccess) {
smsDialog.addEventListener('complete', onSuccess);
}
}
}
要使此代码在iOS上工作,必须使用模块。对于android,您不需要任何模块。如果您只想使用自己的信息打开SMS应用程序,您可以使用以下功能:
Ti.Platform.openURL("sms:01234567891&body=hey");
请注意,号码和正文都是可选的。请告知以下代码的作用是什么<代码>Ti.Android.currentActivity.startActivityForResult(intent,onClose)代码>