flutter firebasessemessing令牌

发布于 2025-02-11 17:05:18 字数 165 浏览 1 评论 0原文

等待firebasemessaging.instance.gettoken();

我使用此代码获取令牌 但是显然,这个代码只给了我设备的令牌, 例如,如果我在应用程序中使用了许多帐户,那么每个帐户我都会得到相同的令牌。 但是,如果我使用其他设备,我会得到不同的令牌。

await FirebaseMessaging.instance.getToken();

I used this code to get token
but apparently this code just give me the token of the device,
For example, if i uses many accounts in my app, i'll get the same token for every accounts.
But if i use another device, i'll get different token.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

叹倦 2025-02-18 17:05:19

firebase消息传递令牌与设备上的安装应用程序相关,而不是与特定用户相关。

看:

捕获设备注册令牌以通过Firebase Cloud消息发送通知的正确方法是什么?

断肠人 2025-02-18 17:05:19

FCM令牌是基于应用程序,其捆绑ID和设备生成的,这就是为什么每个设备的唯一应用程序的独特之处。

The FCM token is generated based on the app , its bundle id and device thats why its unique for each devices for same app.

少女的英雄梦 2025-02-18 17:05:19

Flutter Firebasemessing令牌是特定于设备的。如果您想更改令牌,则可以重新安装该应用程序。
如果要根据用户代币,则可以使用Tokenrefresh方法。

Flutter firebaseMessaging Token is device specific.If you want to change your token then you can reinstall the app.
If you want token based on user then you can use TokenRefresh method.

两人的回忆 2025-02-18 17:05:19

令牌是根据客户端应用程序生成的。

在您的应用程序的初始启动时,FCM SDK为客户端应用程序实例生成注册令牌。

请参阅 FCM注册令牌管理管理的最佳实践

当时只有一个用户在应用程序实例上登录。

The token is generated per the client app instance.

On initial startup of your app, the FCM SDK generates a registration token for the client app instance.

See Best practices for FCM registration token management for details.

Only one user at the time is logged in on the app instance. Delete the token when a user logs out and then you get a new token when a new user logs in.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文