Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No token renewal on OS update #29

Open
adrien-aubel opened this issue Apr 27, 2015 · 6 comments
Open

No token renewal on OS update #29

adrien-aubel opened this issue Apr 27, 2015 · 6 comments
Assignees

Comments

@adrien-aubel
Copy link

When Android is upgraded, Google offers no guarantee the GCM token will keep working, and we saw some cases where GCM would stop working after an upgrade to Android 5.1.

EasyGCM should probably listen to system boot and renew the GCM token if needed:

<uses-permission
    android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
...
<receiver android:name=".BootReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
</receiver>

Waiting a few seconds for the network to be available, or even better, some exponential backoff, could be a good idea.

@DanielNovak
Copy link

This would require adding a new permission (RECEIVE_BOOT_COMPLETED) - which I would like to avoid. I think we could do this as an optional feature of the library - you would specify the permission in your application manifest and the library would then handle it. I will have to think about this. Or maybe if someone can submit a pull request.

@adrien-aubel
Copy link
Author

@DanielNovak do you have any news about this?

If you want a PR, what would be some code design guidelines you'd have in mind?

@DanielNovak
Copy link

@adrien-aubel Sorry - no news yet, but I have it in my backlog. I haven't thought about it in detail yet - so now specific code guidelines :-(. I can't promise an ETA, but I would like to at least start this weekend on this.

@adrien-aubel
Copy link
Author

Ping @DanielNovak :)

@martinadamek
Copy link
Contributor

@adrien-aubel do not worry about code guidelines, regular Android style is fine. Just make a PR, that's where we can discuss :-)

@peterbartos
Copy link
Contributor

This could be fixed in version 1.5.0 as we started using com.google.android.gms.iid.InstanceID intent filter to renew the registration ID. This should be called also when device information is changed, which is probably also this case. More info here: https://developers.google.com/instance-id/guides/android-implementation

Probably needs testing, before we can close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants