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

    1. <small id='09A4z'></small><noframes id='09A4z'>

    2. <tfoot id='09A4z'></tfoot>
        <bdo id='09A4z'></bdo><ul id='09A4z'></ul>
      <legend id='09A4z'><style id='09A4z'><dir id='09A4z'><q id='09A4z'></q></dir></style></legend>

        使用 API 时 Firebase API 不发送推送通知

        时间:2023-07-30

          <tbody id='MobMp'></tbody>

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

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

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

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

                  本文介绍了使用 API 时 Firebase API 不发送推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在从 Parse 迁移到 Firebase,并且遇到了我们的 ios 应用程序的问题.Firebase API 不会向 ios 应用发送推送通知.这是我发送给 https://fcm.googleapis.com/fcm/send的内容p>

                  I'm migrating from Parse to Firebase and facing a problem with our ios app. The Firebase API does not send push notifications to the ios app. This is what im sending to https://fcm.googleapis.com/fcm/send

                  { 
                   "to: "<registration token>",
                   "priority": "high",
                   "data": {
                       "customId": "<my custom id>",
                       "badge": 1,
                       "sound": "cheering.caf",
                      "alert": "New data is available"
                    }
                  }
                  

                  服务器返回成功

                  {
                      "multicast_id":6917019914327105115,
                      "success":1,
                      "failure":0,
                      "canonical_ids":0,
                      "results":[{"message_id":"0:1468961966677585%f0f84693f9fd7ecd"}]
                  }
                  

                  但是推送没有送达.如果我使用 Firebase 仪表板发送推送,即使我直接使用 Token 定位,推送也会被传递.

                  But the push is not delivered. If I sent the push using the Firebase Dashboard, the pushes are delivered, even if I targeting directly with the Token.

                  我看到另一个开发者在另一个 Stackoverflow 问题中抱怨无法使用服务器 API 发送推送通知

                  I saw another developer complaining in another Stackoverflow question Can't send push notifications using the server API

                  我尝试了他们添加 "priority": "high" 的解决方案,但并没有解决问题.但它给了我一个线索:他们也在使用 dev/sandbox 推送证书.

                  I tried their solution of adding the "priority": "high", it did not fixed the issue. But it gave me a clue: They are also using the dev/sandbox push certificate.

                  我怀疑 Dashboard 可以使用 ios Development 证书,但 API 不能.该问题仅发生在 ios 设备上,因为 android 应用正在通过 API 获取推送.

                  My suspicion is that the Dashboard can use the ios Development certificate, but the API can not. The problem only happen on the ios device, since the android app are getting the pushes through API.

                  是否有人可以使用 API 和开发证书发送推送?

                  Is anyone able to send pushes using the API and the development certificate?

                  推荐答案

                  Firebase 支持人员联系了我,并找出了问题所在

                  I got contacted by Firebase support and was able to find out what is wrong

                  我的推送负载缺少通知对象

                  My push payload was missing a notification object

                  { 
                   "to": "<registration token>",
                   "priority": "high",
                   "notification": {
                      "title": "Your Title",
                      "text": "Your Text"
                    }
                   "data": {
                       "customId": "<my custom id>",
                       "badge": 1,
                       "sound": "cheering.caf",
                      "alert": "New data is available"
                    }
                  }
                  

                  希望对其他人有所帮助

                  这篇关于使用 API 时 Firebase API 不发送推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:无法使用服务器 API 发送推送通知 下一篇:Firebase 云消息传递 - GCM 规范 ID 是否仍然需要?

                  相关文章

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

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