[Aerogear-users] Aerogear Cordova Push Plugin Android Issue

Erik Jan de Wit edewit at redhat.com
Tue Jan 19 12:25:06 EST 2016


Yes this is an error in the plugin, actually 2 errors it's not a bundle (it
should be a string) and it's not called userData (but user-data).

On Tue, Jan 19, 2016 at 12:21 PM, aamagdi <aamagdi at ejada.com> wrote:

> 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.
> _______________________________________________
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-users
>



-- 
Cheers,
       Erik Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-users/attachments/20160119/f7419dfb/attachment.html 


More information about the Aerogear-users mailing list