[Aerogear-users] Aerogear Cordova Push Plugin Android Issue

aamagdi aamagdi at ejada.com
Tue Jan 19 06:21:54 EST 2016


Hi,

I tried to send a push notification message using the rest sender api as
below
{"message": {
  "alert": "test123",
   "user-data": {  
            "somedata":"0",
            "somedata2":"1234"
   }
}}
if the application in the foreground I can read the "user-date" correctly
under the payload object on the notification received call back, but if the
application wasn't in the foreground the object doesn't contain the payload
data ("user-date").

I make a quick review of the plugin code for Android and found that in this
part 
NotificationMessageHandler.java -> line 77 (Message message = new
Message(extras);) you are creating a new message object from the extras
variable ;that have all the data; then in
Message.java -> line 46 in the class constructor
    public Message(Bundle extras) {
        this(extras.getString("alert"), extras.getString("sound"),
                Integer.parseInt(extras.getString("badge")),
                extras.getString("aerogear-push-id"),
                *extras.getBundle("userData"));*
    }
there is not "userData" field under extras, so this will result of ignoring
all other payload data.

Could you please check it



--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Aerogear-Cordova-Push-Plugin-Android-Issue-tp441.html
Sent from the aerogear-users mailing list archive at Nabble.com.


More information about the Aerogear-users mailing list