I am developing an Android application with Ionic, I want to implement SMS function in my app. I've installed cordova-sms-plugin and added the following code to my app.
.controller('requestCtrl', function($scope,AuthService,RequestService,$cordovaSms) {
$scope.sendsms = function(){
document.addEventListener("deviceready",function(){
var options = {
replaceLineBreaks: false,
android:{
//intent : 'INTENT',
intent : ''
}
};
$cordovaSms.send('9487354083','This is a test sms', options).then(function(){
alert("success! sms was sent");
},function(error){
console.log(error);
alert('Error sending sms!');
});
});
}
})
In the above code, while I use intent: 'INTENT' option I am able to send SMS with default SMS app of my device. But when I use intent: '' option I can't able to send SMS within my app. The Error message is displayed in the device.