Hi,
I am using cordova 3.6.3.
I am using following SMS plugin.
I have added plugin in following way :--
cordova plugin add com.rjfun.cordova.sms
My cordova app when loaded calls the following function doc_onload().
<body onload="doc_onload()">
Then this register the handler for "deviceready". When the device is ready this device ready function is called.
Now the problem inside the initApp() handler is that SMS plugin check does not display any alert message.
I am able to get the alert --> "kk" .
But in the following check if (! SMS ) I did not get any display message. Neither if nor else got satisfied.
Even alert("end"); Does not get displayed inside initApp() event handler.
Please suggest why it is failing ?
function initApp()
{
alert("initApp");
// attach Fastclick handler
FastClick.attach(document.body);
alert("kk");
if (! SMS )
{
alert( 'SMS plugin not ready' );
return;
}
else
{
alert( 'SMS plugin Ok ' );
}
alert("end");
//add SMS arrive listner handler
document.addEventListener("onSMSArrive", processSMS(), false);
}
//function doc_onload(page_type)
function doc_onload()
{
// Do some task
alert("doc_onload");
// add event handler for deviceready function
document.addEventListener("deviceready", initApp(), false);
}
Regards,
Dinesh