Thanks Kato,
I have some additional questions, though, on edge case:
What if our user logs in with multiple devices? An iPhone and iPad for example? We then have >1 legitimate device token per user, and legitimately want to push to >1 token per user. In this case, you can't have the client deleting the old token and saving the new one, because there are several legitimate tokens. Or, consider a user uninstalling the app, so that the app never had time to delete it's own current token.
1. Have the client push new tokens, as they come (from `onTokenRefresh()`, etc) into the database
2. Have our server send the push notification to EVERY token on the list.
3. The response from GCM will tell our server which tokens are valid, which are invalid, which are canonical, etc
4. Our server then cleans up the invalid ones
So then we have these questions still:
1. Is this best practice for the old GCM?
2. If so, does FCM do these same things (telling you which tokens are old, which are new, etc)
3. If so, is there any sample code of "hitting the FCM service, and parsing the response for good/bad tokens, and doing the grooming" (this would be really nice sample code to have available), or documentation about the way the response looks?
Thanks!