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

Erik Jan de Wit edewit at redhat.com
Sat May 14 04:22:10 EDT 2016


Yeah, though he was doing something like that, basically we only support
key values in user-data not complex objects.

On Sat, May 14, 2016 at 5:03 AM, Matthias Wessendorf <matzew at apache.org>
wrote:

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



-- 
Cheers,
       Erik Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20160514/3151202b/attachment-0001.html 


More information about the aerogear-dev mailing list