• <bdo id='WDCun'></bdo><ul id='WDCun'></ul>
      <legend id='WDCun'><style id='WDCun'><dir id='WDCun'><q id='WDCun'></q></dir></style></legend>

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

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

        无法解析符号 com.google.firebase.messaging.Message

        时间:2024-05-10
          <tbody id='TfsOE'></tbody>

      2. <small id='TfsOE'></small><noframes id='TfsOE'>

      3. <tfoot id='TfsOE'></tfoot>
          <bdo id='TfsOE'></bdo><ul id='TfsOE'></ul>

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

                <i id='TfsOE'><tr id='TfsOE'><dt id='TfsOE'><q id='TfsOE'><span id='TfsOE'><b id='TfsOE'><form id='TfsOE'><ins id='TfsOE'></ins><ul id='TfsOE'></ul><sub id='TfsOE'></sub></form><legend id='TfsOE'></legend><bdo id='TfsOE'><pre id='TfsOE'><center id='TfsOE'></center></pre></bdo></b><th id='TfsOE'></th></span></q></dt></tr></i><div id='TfsOE'><tfoot id='TfsOE'></tfoot><dl id='TfsOE'><fieldset id='TfsOE'></fieldset></dl></div>
                • 本文介绍了无法解析符号 com.google.firebase.messaging.Message的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在按照以下链接实现 Firebase 消息传递以将消息发送到多个设备

                  I'm following the below link to implement Firebase Messaging to send messages to multiple devices

                  https://firebase.google.com/docs/cloud-messaging/android/send-multiple#build_send_requests

                  我几乎完成了实现,但只是停留在最后阶段(构建发送请求)

                  I'm almost done with the implementation but just stuck at the last stage (Build send requests)

                  在下面的代码中

                  Message message = Message.builder()
                      .putData("score", "850")
                      .putData("time", "2:45")
                      .setTopic(topic)
                      .build();
                  

                  我收到错误无法解析符号消息"

                  也行

                  String response = FirebaseMessaging.getInstance().send(message);
                  

                  当我 Ctrl+单击 send() 方法时,参数 message 显示为 RemoteMessage 的实例,而不是返回的 Messagevoid 的类型而不是 String

                  When I Ctrl+click the send() method, the argument message is being shown as instance of RemoteMessage and not Message with return type of void and not String

                  我是否缺少任何依赖项,或者最新的 firebase 消息传递库中的实现是否有任何变化?

                  Am I missing any dependencies or is there any change in implementation in the latest library of firebase messaging?

                  我在我的应用级别 build.gradle

                  implementation 'com.google.firebase:firebase-messaging:19.0.1'
                  implementation 'com.google.firebase:firebase-core:17.0.1'
                  

                  推荐答案

                  Message 类在 Firebase admin sdk 中,但你不能在你的 android 项目中使用它,你只能使用 firebase admin sdk在服务器端,然后您将能够使用 Message 类.检查文档以供参考:-

                  The Message class is inside the Firebase admin sdk but you cannot use that in your android project, you can only use firebase admin sdk in the server side and then you will be able to use the Message class. Check the docs for reference:-

                  https://firebase.google.com/docs/cloud-messaging/管理主题

                  为了能够使用 admin sdk,你需要一个像 Tomcat 这样的服务器,你也应该使用 java 版本 8,然后你可以按照以下教程进行操作:-

                  To be able to use the admin sdk, you need a server like Tomcat, you should also use java version 8, then you can follow the following tutorial:-

                  https://firebase.google.com/docs/admin/setup/#先决条件

                  原答案

                  你需要使用RemoteMessage类,例如:

                  RemoteMessage message = RemoteMessage.builder()
                      .addData("score", "850")
                      .addData("time", "2:45")
                      .build();
                  

                  点击这里了解更多信息:

                  Check here for more information:

                  https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/RemoteMessage

                  https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/RemoteMessage.Builder.html

                  这篇关于无法解析符号 com.google.firebase.messaging.Message的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:com.google.android.gms.common.internal.safe parcel.safe parc 下一篇:单击通知不会打开提及的活动

                  相关文章

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

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

                      <bdo id='uvT1o'></bdo><ul id='uvT1o'></ul>
                    1. <small id='uvT1o'></small><noframes id='uvT1o'>