Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning
titleAndroid forground

Please note that on android foreground push open will not be shown

...

Code Block
languagejs
titleadd event listener
document.addEventListener('deviceready', this.onDeviceReady, false);

 

step2 :Listen toresumeevent  and activate it explicitly for the first time(iOS only)

Code Block
languagejs
titleadd event listener
onDeviceReady: function() {
        onResume();
        document.addEventListener("resume", onResume, false);
        app.receivedEvent('deviceready');
        console.log('Received Event: ' + id);
    },

Step 3 - implement the onResume function(iOS only)

When the application is resumed the following code will check if it was due to push notification. if so feel free to extract the relevant custom field from the payload

...