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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bourillon, Matthias

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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Summers Pittman
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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Summers Pittman
Matthias,


If would can, can you test this PR against your code and confirm the issue is fixed for you?  If you don't want to build the project (and you probably don't need to) I have attached the aar for the PR to this post.

On Wed, Jul 29, 2015 at 1:48 PM, Summers Pittman <[hidden email]> wrote:
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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users




_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users

aerogear-android-push-2.2.1-SNAPSHOT.aar (43K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Bourillon, Matthias

Hello,

After using pull #46 from Github into my local environment, I confirm that this fixes the issue I had.

Are you going to provide any 2.2.1 jar file that we can include into our projects?

 

Thanks,

Matthias

 

 

De : [hidden email] [mailto:[hidden email]] De la part de Summers Pittman
Envoyé : jeudi 30 juillet 2015 00:17
À : [hidden email]
Objet : Re: [Aerogear-users] Android SDK - Token not renewed when unregistering/registering

 

Matthias,

 

 

If would can, can you test this PR against your code and confirm the issue is fixed for you?  If you don't want to build the project (and you probably don't need to) I have attached the aar for the PR to this post.

 

On Wed, Jul 29, 2015 at 1:48 PM, Summers Pittman <[hidden email]> wrote:

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users

 

 


_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Summers Pittman
We are planning on making a release to maven central soon (possibly by the end of next week).  Stay tuned.

On Thu, Jul 30, 2015 at 6:15 AM, Bourillon, Matthias <[hidden email]> wrote:

Hello,

After using pull #46 from Github into my local environment, I confirm that this fixes the issue I had.

Are you going to provide any 2.2.1 jar file that we can include into our projects?

 

Thanks,

Matthias

 

 

De : [hidden email] [mailto:[hidden email]] De la part de Summers Pittman
Envoyé : jeudi 30 juillet 2015 00:17
À : [hidden email]
Objet : Re: [Aerogear-users] Android SDK - Token not renewed when unregistering/registering

 

Matthias,

 

 

If would can, can you test this PR against your code and confirm the issue is fixed for you?  If you don't want to build the project (and you probably don't need to) I have attached the aar for the PR to this post.

 

On Wed, Jul 29, 2015 at 1:48 PM, Summers Pittman <[hidden email]> wrote:

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users

 

 


_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Daniel Passos
Hi Matthias

I've just send[1] it to our Nexus. I'll invite other to test it and if we don't get any other problem, I'll release it next Friday.

[1] https://repository.jboss.org/nexus/content/repositories/jboss_releases_staging_profile-5774/

-- Passos

On Thu, Jul 30, 2015 at 9:16 AM, Summers Pittman <[hidden email]> wrote:
We are planning on making a release to maven central soon (possibly by the end of next week).  Stay tuned.

On Thu, Jul 30, 2015 at 6:15 AM, Bourillon, Matthias <[hidden email]> wrote:

Hello,

After using pull #46 from Github into my local environment, I confirm that this fixes the issue I had.

Are you going to provide any 2.2.1 jar file that we can include into our projects?

 

Thanks,

Matthias

 

 

De : [hidden email] [mailto:[hidden email]] De la part de Summers Pittman
Envoyé : jeudi 30 juillet 2015 00:17
À : [hidden email]
Objet : Re: [Aerogear-users] Android SDK - Token not renewed when unregistering/registering

 

Matthias,

 

 

If would can, can you test this PR against your code and confirm the issue is fixed for you?  If you don't want to build the project (and you probably don't need to) I have attached the aar for the PR to this post.

 

On Wed, Jul 29, 2015 at 1:48 PM, Summers Pittman <[hidden email]> wrote:

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users

 

 


_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users




--
-- Passos

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users