[Aerogear-users] Android SDK - Token not renewed when unregistering/registering

Summers Pittman supittma at redhat.com
Wed Jul 29 13:48:21 EDT 2015


Matthias,

Hey, thanks for this we will work something out asap.  We'll let you know
as soon as we get a fix in place and have a package staged for you to test.



On Wed, Jul 29, 2015 at 12:34 PM, Bourillon, Matthias <
Matthias.Bourillon at saint-gobain.com> wrote:

>  Hello,
>
> I have used Aerogear Android SDK (2.2.0)  in a native Android App to
> communicate with an Aerogear Unified Push server and to use Google Cloud
> Messaging.
>
>
>
> After several tests we have identified an issue with token management :
>
> -          register() successfully generates a token *A* against GCM and
> registration is OK on Aerogear server side
>
> -          unregister() successfully invalidates the token *A* against
> GCM (“NotRegistered” is generated on GCM side when re-using the token) and
> unregistration is OK on Aerogear server side
>
> -          when calling register() back, registration happens against
> Aerogear server but with *token A* which has been invalidated by GCM
>
>
>
> After analyzing the SDK source code, we realized that the token is saved
> in Android Shared Preferences but this token is never removed from shared
> preferences when calling unregister()!
>
>
>
> As a consequence, when a user unregisters/registers to a variant*, the
> “old” token is not renewed* and notification sending fails since Google
> has invalidated this token!
>
>
>
> We quickfixed the AeroGearGCMPushRegistrar class by adding a following
> line in the unregister() method :
>
>
>
> AeroGearGCMPushRegistrar.this.setRegistrationId(context, "");
>
>
>
> However, I am very surprised that this issue was never seen before.
>
> Am I using the registration/unregistration methods incorrectly? How can I
> force the token re-generation against GCM?
>
>
>
> Thanks,
>
> Matthias
>
>
>
>
>
> _______________________________________________
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-users/attachments/20150729/de0115f6/attachment.html 


More information about the Aerogear-users mailing list