I'm trying to install a cordova sms plugin. and I'm doing like te following steps:
phonegap create smsProj
phonegap platform add android
cordova plugin add com.jsmobile.plugins.sms
SMS
is available by:try {
alert( SMS == undefined );
} catch (e) {
alert('catch: SMS is not available')
}
I'm checking this after deviceReady
event, in Android, latest cordova and of course by building and installing in real device. but I'm getting the catch alert every time.
What I am doing wrong?
you need to add this line into your config.xml
file:
<gap:plugin name="com.rjfun.cordova.sms" source="npm"/>
this configuration must be added programmatically since you've installed the plugin using CLI
, but in this case it's not what I expected. I figured it out opening the apk
file content and checking cordova plugins JS file.