我应该将 Expo 推送通知令牌视为敏感信息吗?如果是这样,我如何以安全的方式发送通知?
在我的应用程序中,用户向某人发送消息后,会触发另一个函数来通知接收者。为此,发送者必须拥有接收者的推送令牌(前端)。我的问题是:那安全吗?有更好的方法吗?
我正在使用 Firebase,但我无法找到通过 Google Cloud Functions 发送此通知的方法...
In my app, after a user sends a message to someone, another function is triggered to notify the receiver. For that, the sender has to have the receiver's push token (front end). My question is: Is that safe? Is there a better approach?
I'm using Firebase but I couldn't figure out a way to send this notification through Google Cloud Functions...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以将其视为敏感信息。令牌可能包含恶意用户访问时可用于冒充您的应用程序并向用户发送自己的消息的信息。虽然尚未报告实例,但遵循最佳安全实践是明智之举。
根据此文档使用 Expo 的推送 API 发送通知
您可以查看此博客实施推送使用 Expo 和 Firebase Cloud Functions 进行通知,了解如何安全地推送通知。
Yes you can treat it as sensitive information. Tokens could contain information that when a malicious user accessed, it can be used to impersonate your app and send their own messages to users. While there's no reported instance (yet), it would be wise to follow the best security practices.
According to this documentation on Sending Notifications with Expo's Push API
You can check this blog on Implementing Push Notifications with Expo and Firebase Cloud Functions on how to push notifications securely.