Issue with closed app in iOS

Comments

5 comments

  • Avatar
    Max Konev

    Do you use native code or Phonegap/Cordova?

  • Avatar
    vishnurajreubro

    Phonegap is used

  • Avatar
    Max Konev

    Please make sure you call onDeviceReady method when your app starts:

    pushNotification.onDeviceReady();
    
  • Avatar
    vishnurajreubro

    Yes i'm calling if after ondeviceready.

    var pushNotification; document.addEventListener("deviceready", onCallDeviceReady, false);

    function onCallDeviceReady() {

                   //alert("Device Ready Now");
    

    registerPushNoti(); // Registration function - > SUCCESS

       listenPush();  // Push Listen Event - > Success only when app is ON.
    

    }

    function listenPush() { document.addEventListener('push-notification', function(event) {

    //alert("CALL FROM PUSH");
    var notification = event.notification;
    pushNotification.setApplicationIconBadgeNumber(0);
    if(notification.queueId){
        if(!downloadStatus){
            navigator.notification.confirm(locWOReady,function(btnIndex) {
           if(btnIndex==1) {
              app.twirlyThing(app, true); 
                queIdtoUpdate = notification.queueId;
                callWODownPush(notification.queueId);
    
           }else{
                // do something when Cancel button pressed
                }
      },"");
        }else
        {
           navigator.notification.alert("Download in progress.",null,""); 
        }
    
    }
    
    
    
    });
    

    }

  • Avatar
    Max Konev

    No, not onDeviceReady Cordova method. I meant Pushwoosh plugin method onDeviceReady. pushNotification.onDeviceReady(); For example right above registerPushNoti(); function call

Please sign in to leave a comment.