问题
This question is about device groups and how to efficiently keep track of valid tokens.
The problem I see is when a token is refreshed on a device and you send it to the server, how are you going to identify the old token that is not valid anymore. The device token is used to identify the device but it has been changed so there is no relation anymore between the device and the old token.
Am i supposed to just check the validity of all the tokens that belong to a device group every now and then to filter out the invalid ones?
Lets say a user logs in with a new device, adding this new device to his device group which already contains 5 tokens. At that moment i could take all the tokens and validate each one, removing the ones that dont apply no more.
I could trigger the same process when a user uploads a new token on refresh.
I dont see any other way. Is this how its done or did I miss something?
来源:https://stackoverflow.com/questions/47159375/how-should-i-update-an-existing-firebase-token-on-my-server-when-it-gets-refresh