服务器中的Firebase令牌管理 [英] Firebase token management in servers
问题描述
我还是刚接触Firebase和android通知.我希望能够根据一些规则将通知发送给单个用户.到目前为止,我一直在阅读的内容是可以通过以下方式生成令牌:
I still new with firebase and android notifications. I want to be able to send notifications to a single user based on some rules. What I've been reading so far is that a token can be generated with:
FirebaseInstanceId.getInstance().getToken()
然后,令牌将在过期时的某个时候需要刷新.
Then, the token will need to be refreshed at some point when it expires.
如果可能的话,如何设置这些令牌的有效期?如果大约有一千个用户在同一时间刷新其令牌,那么我将需要对这些令牌进行一千次写入我的应用服务器的操作.是否有解决此问题的已知缩放解决方案(例如,保留相同的令牌但仅刷新其到期时间)?
How to I set expiry for these tokens, if at all possible? If there are a thousand users having their tokens refreshed around the same time then I will need to do a thousand writes for these tokens to my app servers. Is there a known scaling solution for this problem (eg. keep the same token but refresh its expiry only)?