-
Notifications
You must be signed in to change notification settings - Fork 206
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
Easy way to know which registrationTokens to replace/remove in your database #226
Comments
Hi @davidvavra, Check out this great example by @hypesystem. |
Yes I know it's possible. But it's not easy - developer needs to understand the concepts from the official documentation and write some non-trivial logic to detect which registrationIds to replace and which to remove. The library could make developer's life easier and provide two clear callbacks. |
Definitely not something we considered before, but interesting nonetheless. @hypesystem what do you think about this? |
I am implementing GCM now and this is something I was looking for in the documentation (similar to https://github.com/argon/node-apn). |
A simple example on how you could collect the "bad tokens"
This issue needs to be documented, it's kind of silly that you have to dig through the issues to find it. |
Thanks @johanforssell for the example code. I think you're right, we can easily add this to the main README. What do you think @hypesystem? |
Here's a PR for a change of documentation: #323 |
#323 is merged, this issue can be closed |
Well my intention was that "get bad tokens" would be part of the library API and people won't have to implement it, since everybody who uses the library has to do it. But a documented way is definitely an improvement. |
To be honest, a built-in way would be great 😄 if you feel like doing a PR on it, @davidvavra, we would definitely merge! |
According to GCM documentation, implementations of GCM server should replace or remove some registrationTokens from database in some cases like when the app was uninstalled from user's phone. I looked in the code and the information is hidden in the response object. It would be great if the developer can get a simple callback "replace these regTokens with these" and "remove these regTokens"
The text was updated successfully, but these errors were encountered: