我正在使用cordova-sms-plugin插件。 我在使用ngCordova的短信插件时遇到了一些麻烦。如果我发送的消息的意图选项设置为' INTENT',一切正常,提示安装了SMS应用程序。但是,当我将意图设定为' ' (使用android的原生短信发送者),我的应用程序崩溃了。这是代码:
@for (int j = 1; j <= numberOfTravelers; j++)
{
<input type="text" name="FirstNameEN@(j)" class="input-text full-width" value="" placeholder="First Name" />
}
答案 0 :(得分:0)
intent: ''
相同的{p> intent: 'INTENT'
。
尝试:意图:&#39; blabla&#39;
var options = {
replaceLineBreaks: false, // true to replace \n by a new line, false by default
android: {
intent: 'blabla' // random word
}
};
使用:
$scope.sms = {};
var options = {
replaceLineBreaks: false, // true to replace \n by a new line, false by default
android: {
intent: 'blabla' // random word
}
};
$scope.smsSend = function () {
console.log($scope.sms.phno);
console.log($scope.sms.msg);
document.addEventListener("deviceready", function () {
$cordovaSms
.send($scope.sms.phno, $scope.sms.msg, options)
.then(function () {
// Success! SMS was sent
console.log('Success');
}, function (error) {
// An error occurred
console.log(error);
}); //then
});
};