简体   繁体   中英

Should I save firebase token myself or it will be auto done when registering for remote notifications?

I have a chat app with firebase backend. I want to use firebase cloud functions to see if there is new write in messages so that I can then generate push notification to that device but I am confused about tokens.

Do I have to save tokens every time new user signs up or the token automatically goes to firebase once we use registerForRemoteNotifications.

Also suggest me if you have a better and clear way doing this.

You have to save it yourself.

The tokens are automatically generated, but saving them to a specific location, such as the server is the developer's responsibility.

If you are using Firebase database, then you could just save it to a pushTokens node, making sure that it can only be accessed by the corresponding users, through Firebase Rules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM