<bdo id='3k3Oy'></bdo><ul id='3k3Oy'></ul>

<small id='3k3Oy'></small><noframes id='3k3Oy'>

<tfoot id='3k3Oy'></tfoot>

      <legend id='3k3Oy'><style id='3k3Oy'><dir id='3k3Oy'><q id='3k3Oy'></q></dir></style></legend>
      <i id='3k3Oy'><tr id='3k3Oy'><dt id='3k3Oy'><q id='3k3Oy'><span id='3k3Oy'><b id='3k3Oy'><form id='3k3Oy'><ins id='3k3Oy'></ins><ul id='3k3Oy'></ul><sub id='3k3Oy'></sub></form><legend id='3k3Oy'></legend><bdo id='3k3Oy'><pre id='3k3Oy'><center id='3k3Oy'></center></pre></bdo></b><th id='3k3Oy'></th></span></q></dt></tr></i><div id='3k3Oy'><tfoot id='3k3Oy'></tfoot><dl id='3k3Oy'><fieldset id='3k3Oy'></fieldset></dl></div>

    1. firebase的app token在什么时期发生变化,如何管理?

      时间:2023-07-30

      1. <small id='dmsXA'></small><noframes id='dmsXA'>

          • <bdo id='dmsXA'></bdo><ul id='dmsXA'></ul>
                <tbody id='dmsXA'></tbody>
              <legend id='dmsXA'><style id='dmsXA'><dir id='dmsXA'><q id='dmsXA'></q></dir></style></legend>
            • <tfoot id='dmsXA'></tfoot>
              <i id='dmsXA'><tr id='dmsXA'><dt id='dmsXA'><q id='dmsXA'><span id='dmsXA'><b id='dmsXA'><form id='dmsXA'><ins id='dmsXA'></ins><ul id='dmsXA'></ul><sub id='dmsXA'></sub></form><legend id='dmsXA'></legend><bdo id='dmsXA'><pre id='dmsXA'><center id='dmsXA'></center></pre></bdo></b><th id='dmsXA'></th></span></q></dt></tr></i><div id='dmsXA'><tfoot id='dmsXA'></tfoot><dl id='dmsXA'><fieldset id='dmsXA'></fieldset></dl></div>

                本文介绍了firebase的app token在什么时期发生变化,如何管理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是 firebase 的新手,我正在学习它,就像一个蹒跚学步的孩子学习走路一样.到目前为止,我已经设法使用 firebase 框架为我的手机生成的令牌向我自己的手机发送消息.现在这是棘手的地方(在我看来).FirebaseInstanceIdService 扩展服务中有一个名为onTokenRefresh() 的方法.既然叫refresh,那么我假设它会改变.我想知道这个令牌是什么时候创建的,什么时候会改变?

                I am new to firebase I am learning it like a toddler learning to walk. So far I have managed to send a message to my own phone using a token generated for my phone by firebase framework. Now here's where it gets tricky (in my opinion). There is a method called onTokenRefresh() in the FirebaseInstanceIdService extended service. Since it is called refresh, Then I am assuming that it will change. I want to know when this token is created and when will it be changed?

                如果它发生变化,假设我向带有令牌A"的设备发送消息,该设备目前处于离线状态,因此它将排队.现在,当设备上线时,它会将令牌刷新"为B".现在,由于消息应该被传递到令牌A",因此消息将永远不会被传递.我该如何处理这种情况?

                And if it changes, suppose I send a message to a device with token 'A' which is offline for now, so it will be queued. Now when the device gets online, it will "refresh" the token to 'B'. Now as the message was supposed to be delivered to token 'A', the message will never be delivered. How can I manage this situation?

                推荐答案

                token 生成,app 首次启动后,只要手机能连接到谷歌服务器.由于所需的连接性,这可能不会立即发生,但在大多数情况下,它会在用户打开应用程序后几秒钟内发生.一旦生成令牌,就会调用方法 onTokenRefresh().

                The token is generated, after the app is first launched, as soon as the phone can connect to the Google servers. Due to the required connectivity this might not happen immediately, but in most of the cases it will happen in few seconds after the user open the app. As soon as the token is generated the method onTokenRefresh() is called.

                正如您指出的,令牌可以更改,在这种情况下,将再次调用 onTokenRefresh() 方法.
                刷新事件在某种程度上很少见,根本不要指望经常看到它.

                As you pointed out the token can change, in which case the onTokenRefresh() method will be called again.
                The refresh event is somehow rare, don't expect to see it often at all.

                当刷新令牌发生时,所有已成功"发送(API 向您返回消息 ID)到旧令牌的消息都将被传递.

                When the refresh token happens, all the messages that have been "successfully" sent (the API returned you a message-id) to the old token will be delivered.

                最后,即使在刷新之后,旧令牌仍会在短时间内工作,以允许应用将新令牌传送到其后端.

                Finally, even after the refresh happened the old token will still be working for a short period, to allow the app to communicate the new token to its back-end.

                这篇关于firebase的app token在什么时期发生变化,如何管理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:我现在应该使用什么方法,因为 FirebaseInstanceId.getInstance().getToken() 已 下一篇:如何在单击推送通知时打开特定屏幕以进行颤动

                相关文章

                  1. <tfoot id='FeosF'></tfoot>
                    • <bdo id='FeosF'></bdo><ul id='FeosF'></ul>
                    <i id='FeosF'><tr id='FeosF'><dt id='FeosF'><q id='FeosF'><span id='FeosF'><b id='FeosF'><form id='FeosF'><ins id='FeosF'></ins><ul id='FeosF'></ul><sub id='FeosF'></sub></form><legend id='FeosF'></legend><bdo id='FeosF'><pre id='FeosF'><center id='FeosF'></center></pre></bdo></b><th id='FeosF'></th></span></q></dt></tr></i><div id='FeosF'><tfoot id='FeosF'></tfoot><dl id='FeosF'><fieldset id='FeosF'></fieldset></dl></div>
                    <legend id='FeosF'><style id='FeosF'><dir id='FeosF'><q id='FeosF'></q></dir></style></legend>
                  2. <small id='FeosF'></small><noframes id='FeosF'>