I have tried implementing 3 different plug-in's for this in cordova-2.1.0
But nothing has worked out..
Plugin No: 1
source: here
error faced: full plugin file rather the java file had errors and had asked to create field names such as cordova call back content...etc
Plugin No: 2
source: here
error faced: no responsei am able to enter the phone no and message..i am supposed to get an alert with the number and message but did not get it.could not decode
Plugin No: 3
source: here
error faced: while i called just this in the sms function**
sendSMS.send(‘Mobile Number’, ‘Text’, ‘Call back function on complete’);
i got an error of
05-31 15:03:05.879: E/Web Console(15239): Uncaught ReferenceError: sendSMS is not defined at file:///android_asset/www/index.html:14.
when i gave this
var sendSMS = {
send : function(phone, message, successCallback, failureCallback) {
return cordova.exec(successCallback, failureCallback, 'SmsPlugin',"SendSMS", [ phone, message ]);
}
};
if (!window.Cordova) {
window.Cordova = cordova;
};
sendSMS.send('Mobile Number', 'Text', 'Call back function on complete');
i got a toast message as generic failure and then in the logcat as
05-31 15:04:23.082: E/ActivityThread(15400): Activity com.phone.gap.fist proj.MainActivity has leaked IntentReceiver com.phonegap.plugins.sms.SmsPlugin$2@414f1068 that was originally registered here. Are you missing a call to unregisterReceiver()?
Use the social plugin a common one for SMS,E-MAIL and opening all the social network applications available on your device.
Its simple to implement.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.