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

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

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

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

        图片未显示在推送通知中

        时间:2023-07-29

          • <bdo id='ym8XN'></bdo><ul id='ym8XN'></ul>

                <tbody id='ym8XN'></tbody>
              <legend id='ym8XN'><style id='ym8XN'><dir id='ym8XN'><q id='ym8XN'></q></dir></style></legend>
            1. <small id='ym8XN'></small><noframes id='ym8XN'>

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

                  本文介绍了图片未显示在推送通知中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用下面的通知负载并使用 Postman 向 Android 设备发送推送通知:

                  I am using the notification payload below and use Postman to send a push notifications to Android devices:

                  {
                      "to" : "/topics/xxxx" ,
                      "data" : {
                          "url" : "https://res.cloudinary.com/demo/image/upload/w_200/lady.jpg",
                          "dl" : ""
                      },
                      "notification" : {
                          "title" : "This is a sample notification from general2",
                          "body" : "Rich notification testing (body)",
                          "image": "https://res.cloudinary.com/demo/image/upload/w_200/lady.jpg"
                      }
                  
                  }
                  

                  我已使用 image 键值对在推送通知中包含图像.我的预期输出是:

                  I have used the image key value pair to include an image in the push notification. My expected output is:

                  但这就是它在手机中显示的内容:

                  But this is what it is showing in the phone:

                  如您所见,图像没有出现.可能是什么问题?

                  As you can see, the image is not appearing. What might be the problem?

                  推荐答案

                  我发现问题在于激进的节电模式.例如,小米和三星(尤其是 Android 11)手机将限制 FCM 进行后台联网(获取图像),因此图像将丢失.这只会在手机处于深度睡眠时发生.如果不是(并且您的应用程序已关闭或在后台),则将显示图像.如果应用在前台,会调用onMessageReceived(),反正需要手动获取图片,不受手机限制.

                  I found out the problem is in aggressive battery savers. For example, Xiaomi and Samsung (Android 11 especially) phones will restrict FCM to do background networking (to fetch the image), thus, the image will be missing. This will only happen when phone is in deep sleep. If it's not (and your app is closed or in background), the image will be showing. If the app is in foreground, onMessageReceived() will be called and you need to fetch the image manually anyways and it will not be restricted by phone.

                  遗憾的是,除了用户手动为您的应用禁用节电功能之外,我没有找到任何解决方法:/

                  Sadly, I didn't find any workaround around this, except users manually disabling battery saving for your app :/

                  这篇关于图片未显示在推送通知中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在带有 FCM 的 iOS 上使用富推送通知中的数据 下一篇:在 Swift 2 中发出 HTTP POST 请求

                  相关文章

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

                    • <bdo id='fJ7Pd'></bdo><ul id='fJ7Pd'></ul>

                    <tfoot id='fJ7Pd'></tfoot>

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