gpt4 book ai didi

Android - 一个应用程序中有两个或多个 GCM token

转载 作者:行者123 更新时间:2023-11-29 19:35:43 25 4
gpt4 key购买 nike

是否可以在同一个 Android 应用程序中获取两个或多个不同的 GCM token ,并能够同时接收发送给任一应用程序的消息?

最佳答案

它可能会发生,但最终,您无法以可以同时接收发送给任何一个的消息的方式使用它。 token 是在您的应用上线时创建的。这将落在 Canonical IDs :

If a bug in the client app triggers multiple registrations for the same device, it can be hard to reconcile state and the client app might end up with duplicate messages.

Implementing canonical IDs can help you more easily recover from these situations. A canonical registration ID is the registration token of the last registration requested by the client app . This is the ID that the server should use when sending messages to the device.

If you try to send a message using an old registration token, GCM will process the request as usual, but it will include the canonical ID in the registration_id field of the response. Make sure to replace the registration token stored in your server with this canonical ID, as eventually the old registration token will stop working.

以下是一些可能对您有帮助的链接:

关于Android - 一个应用程序中有两个或多个 GCM token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39217230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com