I'm trying to send a message using The "Sendsms"plugin for phone gap on Android. But when I call the function, I get this error:
Uncaught TypeError: Cannot call method 'send' of undefined at file
This is the JS code I'm using :
function onDeviceReady () {
$('#send').bind('click', function () {
alert('Phone: ' + $('#friendName').val() + ' Message: ' + $('#MessageContent').val());
window.plugins.sms.send($('#friendName').val(),
$('#MessageContent').val(),
function () {
alert('Message sent successfully');
},
function (e) {
alert('Message Failed:' + e);
}
);
});
}
document.addEventListener("deviceready", onDeviceReady, false);
I got the java code from here & added the permission:
<uses-permission android:name="android.permission.SEND_SMS"/>
And added the plugin to Plugins.xml.
Do you know what's the problem ?