[Aerogear-users] Trouble sending Android Push Notifications [Solved]

Rob Willett rwillett at robertwillett.com
Thu Nov 26 14:02:22 EST 2015


Sebastien,

Unclear to me what needs to be done.

If its client side then we need to understand what we do to deregister 
and register. e.g. do we do this overtime the user starts the app? That 
doesn’t feel right, though thats just a feeling with nothing to back 
it up.

It feels like this should be a server side activity, though thats not 
because I’m trying to avoid work. I have no idea what the problem is 
(or even if there is a problem). It may well be we have misunderstood 
what needs to happen. I am certainly no expert on Push notifications 
(though we do know an awful lot more than this morning).

We’re putting things on hold for four days as we have a vacation here, 
so we’ll do nothing until Tuesday now. After the last 24 hours I want 
a break to be honest :)

Happy to test ideas out or code, please ask if necessary.

Rob.

On 26 Nov 2015, at 17:01, Sebastien Blanc wrote:

> Great to hear ! And looks like my previous answer was sent while you 
> were
> sending this answer :)
>
> As said in my previous answer, we have some running jobs that cleans 
> up
> invalid tokens but seeing your issues we need to make that more 
> robust, at
> least on our side because maybe things are getting wrong on Google's 
> side
> as well.
>
>
>
> On Thu, Nov 26, 2015 at 5:56 PM, Rob Willett 
> <rob.aerogear at robertwillett.com
>> wrote:
>
>> Got the problem.
>>
>> The device token that was being reported by the UPS Push Console was
>> invalid or out of date.
>>
>> We wrote a quick JavaScript script to register the device and then
>> unregister it.
>>
>> We then forced our app to register again. The device token was 
>> changed
>> in the UPS console variant. We tried to do a Send Push from the 
>> console
>> and it came
>> through fine.
>>
>> We now can see notifications :)
>>
>> Of course its almost the last thing we tried…
>>
>> Now the issue is should the UPS server have got a new device token if
>> the variant was deleted AND the GCM project was deleted? We are not
>> clear when the device token is renewed but either
>>
>> 1. The UPS server should do this automatically when variants are 
>> deleted
>> or some other way of detecting that things have changed.
>>
>> OR
>>
>> 2. Should the app do it. In which case when should push.unregister() 
>> be
>> called. Should we unregister and register every time the app starts 
>> up
>> to make sure the device token is valid. Seems excessive which is why 
>> my
>> first thought is that this should be server side not client side.
>>
>> I don’t know what the answer is, but stale Android device tokens 
>> have
>> been an issue for us. The fact they survive multiple different Google
>> Projects AND multiple different UPS variants makes me think this is 
>> an
>> issue.
>>
>> Anybody care to comment?
>>
>> Rob (who is now going got a coffee as he’s earn it)
>>
>> On 26 Nov 2015, at 16:35, Rob Willett wrote:
>>
>>> Sebastien,
>>>
>>> Well we have created and deleted variants and various Google 
>>> Projects
>>> all with the result. No notification but no errors.
>>>
>>> We have validated the server API key using another curl script
>>>
>>> We have managed to write a curl script that almost works but not 
>>> quite
>>> :) We get a MismatchSenderId error.
>>>
>>> Grepping for this on the intertubes shows a lot of Stackoverflow
>>> nonsense and some stuff from Google.
>>>
>>> What we are now wondering if the device token that we are using, 
>>> that
>>> reported by the AeroGear UPS console is actually out of date.
>>>
>>> When we delete the variant we create a new variant and register with
>>> that. The device token created and reported by the UPS console is 
>>> the
>>> same as the old variant. We are wondering if this is incorrect and 
>>> it
>>> should be a new device token. We’re trying to delete it but you
>>> can’t seem to delete it from the console and trying to delete it
>>> from
>>> our app calls the Javascript error function.
>>>
>>> We’ll keep trying, but our other Android phone packed up yesterday
>>> and
>>> we only one left. We’re pulling out an old Samsung S3 on the off
>>> chance it might work :)
>>>
>>> Any thoughts on invalid device tokens?
>>>
>>> Rob
>>>
>>>>> I can’t believe that we have missed a simple configuration issue
>>>>> on
>>>>> the
>>>>> UnifiedPush server.
>>>>>
>>>> Yes, strange, looks like you are doing everything the correct way
>>>>
>>>>> We’ll try and bypass the UPS console and write direct to GCM now
>>>>> through
>>>>> curl or something. Do you know if the device token in the UPS
>>>>> console
>>>>> is
>>>>> the Android token to use?
>>>>>
>>>> That is good test indeed and yes the token in UPS is the one you 
>>>> can
>>>> use
>>>> for your GCM test.
>>>>
>>>>> Thanks
>>>
>>> _______________________________________________
>>> Aerogear-users mailing list
>>> Aerogear-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/aerogear-users
>> _______________________________________________
>> Aerogear-users mailing list
>> Aerogear-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/aerogear-users
>>
> _______________________________________________
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-users


More information about the Aerogear-users mailing list