目前我正在使用下面的代码来显示消息编辑器,但是它会打开原生的iOS消息应用程序,并且我的应用程序会进入后台。
Titanium.Platform.openURL('sms:'+e.rowData.value);但是我想在我的应用程序中显示消息编辑器。
有没有办法在我的钛合金应用程序中显示iOS的消息编写窗口?
我搜索了很多,但没有得到任何解决方案。并且在appcelerator documentation中没有关于消息编写器的任何内容。
提前感谢
发布于 2013-01-01 13:18:47
目前(2013年1月1日)在钛SDK中没有内置模块可用于集成原生iOS短信视图到钛应用程序中。有很多第三方模块可以做到这一点。
我还开发了一个模块来做这件事,你可以在这里找到。
发布于 2017-06-06 22:28:55
无需使用模块,我有更好的解决方案
Ti.Platform.openURL('sms://‘+Your_phone_number + '&body=’+ encodeURIComponent(MESSAGE_IN_STRING));
这对我很管用。
发布于 2012-12-26 18:21:48
尝尝这个,
var SMS = require('ti.sms');
var sms = SMS.createSMSDialog({
animated: true
});
sms.barColor = 'black';
sms.toRecipients = [
'5678309' // who should receive the text? put their numbers here!
];
sms.messageBody = 'This is a text message.';
sms.addEventListener('complete', function(evt) {
if (evt.success) {
alert('SMS sent!');
}
else {
switch (evt.result) {
case SMS.CANCELLED:
alert('User cancelled SMS!');
break;
case SMS.FAILED:
default:
alert(evt.error);
break;
}
}
});
sms.open();https://stackoverflow.com/questions/14037898
复制相似问题