[aerogear-dev] Unified Push, user-data field and Android push

Matthias Wessendorf matzew at apache.org
Fri May 13 23:03:30 EDT 2016


yeah, here we do it:
https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/GCMPushNotificationSender.java#L102-L107

On Fri, May 13, 2016 at 6:57 PM, Summers Pittman <supittma at redhat.com>
wrote:

> So I had a post on my Google+ (I know that was my reaction too) page from
> a user who was having trouble with UPS, user-data, and Android.  I'm not
> sure WHERE his problem is, but I will describe it here and we can discuss
> further.
>
> Let's say we send the following to UPS using the sender API :
>
> {
>      "message": {
> "alert" : "Remote service failed. View FAQs.",
> "sound": "default",
> "badge": -1,
> "user-data": {
> "SXM": {
> "CATEGORY" : "SERVICE",
> "SERVICETYPE": "Remote",
> "SRID": "BB4FC7F0-15E9-11E6-9F41-0050569C3256",
> "APPCONTENT": "UNKNOWN",
> "STATUS": "FAIL",
> "STATUSCHANGE_DATETIME": "UNKNOWN",
> "URL": "XYZABC.com"
> }
> }
>      }
>    }
>
> Android will receive the following message bundle from Google :
>
> Bundle[
>   {aerogear-push-id=3f2b9477-fc9e-463a-94d7-d62bf55706e1,
>    SXM={CATEGORY=SERVICE, SERVICETYPE=Remote,
> SRID=BB4FC7F0-15E9-11E6-9F41-0050569C3256, APPCONTENT=UNKNOWN, STATUS=FAIL,
> STATUSCHANGE_DATETIME=UNKNOWN, URL=XYZABC.com},
>    alert=Remote service failed. View FAQs.,
>    badge=-1,
>    sound=default,
>    collapse_key=do_not_collapse}
> ]
>
> As we can see, several things have happened.  1) user-data has been rolled
> up into a root element, and the SXM root object's JSON body has been
> stripped of its jsonness.  IDEALLY we would be able to keep the body of
> userdata as a string for user's to handle themselves.
>
> I THINK this is an issue with how UPS converts the message for sending to
> GCM, but i haven't researched that far.
>
> Summers
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20160514/9f129205/attachment.html 


More information about the aerogear-dev mailing list