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

    • <bdo id='5Ofmg'></bdo><ul id='5Ofmg'></ul>

    1. <legend id='5Ofmg'><style id='5Ofmg'><dir id='5Ofmg'><q id='5Ofmg'></q></dir></style></legend>

      <small id='5Ofmg'></small><noframes id='5Ofmg'>

        应用程序处于非活动状态时未调用 Firebase onMessageReceived

        时间:2023-07-28
        <tfoot id='DKhcF'></tfoot>

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

                <small id='DKhcF'></small><noframes id='DKhcF'>

                  <bdo id='DKhcF'></bdo><ul id='DKhcF'></ul>
                • <legend id='DKhcF'><style id='DKhcF'><dir id='DKhcF'><q id='DKhcF'></q></dir></style></legend>
                  本文介绍了应用程序处于非活动状态时未调用 Firebase onMessageReceived的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Android 上使用 Firebase 云消息传递.

                  I am using Firebase Cloud Messaging on Android.

                  • 当应用在前台时,我可以成功接收通知和数据消息.
                  • 文档指出,如果在应用处于后台时收到通知消息,则 Firebase 将代表应用向系统托盘发送通知.这对我不起作用.
                  • 如果发送了一条数据消息并且应用程序在后台,那么 onMessageReceived 方法就会被成功调用.
                  • 麻烦的场景是当我强制停止应用程序然后尝试发送通知或数据信息.在这种情况下,不会调用 onMessageReceived 方法.
                  • 我看过很多关于 SO 的文章讨论后台用例,但是我还没有看到任何解释为什么当应用程序完全停止没有收到消息/strong>.
                  • I can successfully receive notification and data messages when the app is in the foreground.
                  • The documentation states that if a notification message is received while the app is in the background then Firebase will send a notification to the system tray on behalf of the app. This is not working for me.
                  • If a data message is sent and the app is in the background then the onMessageReceived method is called successfully.
                  • The most troubling scenario is when I force stop the application and then try sending a notification or data message. The onMessageReceived method doesn't get called in this situation.
                  • I have seen a number of articles on SO discussing the background use case, but I have yet to see any explanation for why no messages are being received when the app is stopped entirely.

                  我的清单中有以下内容:

                  I have the following in my manifest:

                  <service android:name=".MyFirebaseMessagingService">
                      <intent-filter>
                          <action android:name="com.google.firebase.MESSAGING_EVENT" />
                      </intent-filter>
                  </service>
                  <service android:name=".MyInstanceIdService">
                      <intent-filter>
                          <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
                      </intent-filter>
                  </service>
                  

                  这是关于扩展 FirebaseMessagingService 的文档所说的:

                  This is what the documentation has to say about extending FirebaseMessagingService:

                  如果您想要在后台接收应用通知之外的任何消息处理,则这是必需的.

                  This is required if you want to do any message handling beyond receiving notifications on apps in the background.

                  在后台接收应用程序通知之外的消息处理"是什么意思并不完全清楚.我只能假设他们在谈论关闭应用程序时处理消息.

                  It's not entirely clear what they mean by "message handling beyond receiving notifications on apps in the background". I can only assume that they are talking about handling messages when the app is closed.

                  任何帮助将不胜感激.

                  推荐答案

                  如果您强制停止应用程序,则在 应用程序重新启动之前您不会收到任何通知.在重新启动应用程序之前,您的任何代码都不会工作.

                  If you force stop an app you don't get any notifications until the app is restarted. None of your code will work until the app is restarted.

                  应用的所有服务也将停止,直到用户再次手动启动应用

                  All services of the app will also be stopped until user manually launches the app again

                  这篇关于应用程序处于非活动状态时未调用 Firebase onMessageReceived的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                      <small id='YyqEF'></small><noframes id='YyqEF'>

                        <tbody id='YyqEF'></tbody>
                        <tfoot id='YyqEF'></tfoot>