Empty push object from getLaunchNotification (Android/Phonegap)

On Android using Phonegap, when the application is launched because of a tap on a push notification, the getLaunchNotification method is always returning an empty push object. We are doing the following:

UAirship.getLaunchNotification(false, 
  function(push) { 
    alert(JSON.stringify(push)); 
  } 
);

There are two place where we are checking if the app was launched by an notification:

  1. the app starts (onDeviceReady) 
  2. on resume event (onResume)

Tapping a notification push launches the app and the alert fires showing "{ }". On iOS however, the push contains a message, our extras, etc. We've copied the examples from the docs as well as tried a myriad of combinations for enabling/disabling pushes and user notifications but with no luck.

Didn't find what you were looking for?

New post

Comments

3 comments

  • Hi Shaun,

    I just tested the code snippet you posted and was able to get the push object to show in the alert. Can you please send me the output of the following commands?

    cordova --version
    cordova platform
    cordova plugin

    This will help me troubleshoot your issue more quickly.

    Comment actions Permalink
    0
  • We can't run cordova from the the command line, but updating our phonegap-version to cli-6.0.0 fixed this issue.

    We were previously on cli-5.2.0 and were unable to get this plugin to work.

    Comment actions Permalink
    0
  • Perfect. Glad to hear it.

    If you are using the PhoneGap CLI, I believe these commands should work the same, but replacing "cordova" with "phonegap".

    Please let me know if you have any other questions or concerns.

    Sean

    Comment actions Permalink
    0

Please sign in to leave a comment.