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

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

        <legend id='v2EoP'><style id='v2EoP'><dir id='v2EoP'><q id='v2EoP'></q></dir></style></legend>

          <bdo id='v2EoP'></bdo><ul id='v2EoP'></ul>
      2. 当应用程序在后台时,FCM 无法显示弹出窗口

        时间:2023-07-28

                <tbody id='bUnwD'></tbody>

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

                  <tfoot id='bUnwD'></tfoot>
                • 本文介绍了当应用程序在后台时,FCM 无法显示弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果 fcm 消息包含通知"部分且应用程序在后台,则将通知传递到系统托盘,并在意图的附加内容中提供数据.

                  If fcm message contains "notification" section and app is in the background, Notifications delivered to the system tray and data in extras of the intent.

                  问题是我无法更改此通知的重要性,并且它们始终不显示弹出窗口.我为 api 26+ 解决了这个问题,我用

                  The problem is that I cannot change Importance for this notifications and they always do not show the popup. I fixes this problem for api 26+, i added Notification channel with

                  int importance = NotificationManager.IMPORTANCE_HIGH;
                          NotificationChannel channel = new NotificationChannel(getString(R.string.default_notification_channel_id), name, importance);
                  

                  在清单中

                  <meta-data
                          android:name="com.google.firebase.messaging.default_notification_channel_id"
                          android:value="@string/default_notification_channel_id"/>
                  

                  但是对于 api 25- 我找不到解决方案.一个建议是删除通知"部分并仅保留数据",这将允许 fcm 将消息传递给

                  But for the api 25- i cannot find the solutions. The one suggestions are to remove "notification" section and leave only "data", this will allow fcm deliver messages to

                  onMessageReceived(RemoteMessage remoteMessage)
                  

                  当应用程序处于后台/前台时,我将能够显示我的自定义通知.

                  when app is in background/foreground and I will be able to show my custom notifications.

                  推荐答案

                  我发现的最佳解决方案是仅使用 Data 有效负载并处理 onMessageReceived 中的后台/前台消息方法并显示您的自定义通知.

                  The best solution i have found is to use only Data payload and handle both background/foreground messages inside onMessageReceivedmethod and show your custom notifications.

                  这篇关于当应用程序在后台时,FCM 无法显示弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <tbody id='rXNwS'></tbody>

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

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

                        <bdo id='rXNwS'></bdo><ul id='rXNwS'></ul>