Hi am working on cordova project and i implemented phone gap push plugin for my app.
The device registration is working on some versions of android but not in other.
Is this a problem comes from push plugin or any code change required?
Device id not getting on some versions ,i think lower versions.
Please Note:I tested with real devices not with emulator.
1.Registration
try {
pushNotification = window.plugins.pushNotification;
if (device.platform == 'android' || device.platform == 'Android' || device.platform == 'amazon-fireos' ) {
pushNotification.register(successHandler, errorHandler, {"senderID":"602307454049","ecb":"onNotification"});
}
else {
pushNotification.register(tokenHandler, errorHandler, {"badge":"true","sound":"true","alert":"true","ecb":"onNotificationAPN"});
}
}
catch(err) {
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
// alert(txt);
console.log(txt);
}
2.on ecb
function onNotification(e) {
console.log("EVENT -> RECEIVED:"+ e.event);
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
console.log("regID = " + e.regid);
alert("Device Registred gcm_regid="+e.regid);
}
break;