How should I update an existing firebase token on my server when it gets refreshed by firebase?

你。 提交于 2019-12-23 12:26:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!