0

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;
R3uK
  • 14,417
  • 7
  • 43
  • 77
Lejin KR
  • 477
  • 1
  • 3
  • 18
  • If you can confirm that device registration does work on some devices, it means that your *code* and the *plugin* both work correctly. – Ajoy May 12 '15 at 09:56
  • Do update your question with the device versions or model where the registration does not succeed. AFAIK [PushPlugin](https://github.com/phonegap-build/PushPlugin) should work with all latest devices. – Ajoy May 12 '15 at 10:04

0 Answers0