• <legend id='SBHed'><style id='SBHed'><dir id='SBHed'><q id='SBHed'></q></dir></style></legend>

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

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

        firebase 云消息没有看到小米设备

        时间:2023-07-29

        <legend id='N6r36'><style id='N6r36'><dir id='N6r36'><q id='N6r36'></q></dir></style></legend>
        <tfoot id='N6r36'></tfoot>

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

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

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

                  本文介绍了firebase 云消息没有看到小米设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在构建一个反应原生应用程序.我想从 firebase 发送云消息,但我不能.我准备了项目并安装在我的设备上.其中一个是三星,另一个是小米.当我发送通知时,我可以在我的三星上看到,但在小米上看不到.我也可以使用 fcmToken 发送通知我的虚拟 android 设备.你想我该如何解决这个问题?

                  I'm building an react native app. I want to send cloud messages from firebase but i can't. i prepared project and install on my devices. one of them samsung other one is xiaomi. when i send notification i can see on my samsung but not xiaomi. also i can send notification my virtual android device with fcmToken. do you want how can i fix that problem?

                  firebase 云消息控制台:https://pasteboard.co/IxyD0p3.png

                  firebase cloud messagin console: https://pasteboard.co/IxyD0p3.png

                  System:
                  
                  OS: Windows 10
                  
                  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
                  
                  Memory: 1.46 GB / 7.89 GB
                  
                  Binaries:
                  
                  Node: 10.15.3 - C:Program Files
                  odejs
                  ode.EXE
                  
                  npm: 6.4.1 - C:Program Files
                  odejs
                  pm.CMD
                  
                  IDEs:
                  
                  Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842
                  
                  react-native-cli: 2.0.1
                  
                  react-native: 0.60.5
                  
                  
                  app/build gradle dependencies
                  implementation "com.google.android.gms:play-services-base:16.0.0"
                      implementation 'com.google.android.gms:play-services-gcm:16.0.0'
                      implementation "com.google.firebase:firebase-core:16.0.9"
                      implementation "com.google.firebase:firebase-messaging:19.0.0"
                      implementation 'com.google.firebase:firebase-analytics:17.2.0'
                      implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
                  
                  /build gradle
                  classpath("com.android.tools.build:gradle:3.4.1")
                          classpath('com.google.gms:google-services:4.3.2')
                  

                  推荐答案

                  FCM 通知有两种类型:通知消息数据消息.

                  There are 2 types of FCM notifications: Notification message and Data message.

                  通知消息如下所示:

                  {
                    "message":{
                      "token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
                      "notification":{
                        "title":"Portugal vs. Denmark",
                        "body":"great match!"
                      }
                    }
                  }
                  

                  并触发 FirebaseMessagingService 的 OnMessageReceaved() 方法.许多设备(尤其是华为和小米)试图尽一切努力终止后台服务以防止电池耗尽.所以 FirebaseMessagingService 并不是处理通知的最佳方式.

                  and triggers method OnMessageReceaved() of FirebaseMessagingService. Many devices (especially Huawei and Xiaomi) try to do everything to kill background services to prevent battery drain. So the FirebaseMessagingService isn't the best way to handle notifications.

                  第二种是
                  数据信息:

                  {
                    "message":{
                      "token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
                      "data":{
                        "Nick" : "Mario",
                        "body" : "great match!",
                        "Room" : "PortugalVSDenmark"
                      }
                    }
                  }
                  

                  此类型由系统托盘处理,因此您不需要运行任何服务来获取通知.它更方便的方法,但据我所知,它无法通过控制台实现.

                  This type is handled by the system tray, so you don't need any of service running to get the notification. Its much more convenient method, but as far i know, it can't be achieved with the console.

                  您可能需要服务器 API 来发送数据消息.

                  You would probably need server API to send Data message.

                  阅读此了解更多详情.

                  这篇关于firebase 云消息没有看到小米设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:订阅 FCM for Chrome 中的主题 下一篇:无法更新 Firebase 依赖项(com.google.firebase)

                  相关文章

                1. <tfoot id='FyXDk'></tfoot>

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

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

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