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

Rob Willett rob.aerogear at robertwillett.com
Thu Nov 26 11:56:02 EST 2015


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


More information about the Aerogear-users mailing list