前端时间,印度的应用,增加了firebase推送。

然后,来了新的需求,firebase推送,增加图片。

这是我们第一种方式:

AndroidNotification.Builder(具体使用查看官方文档),自带了setImage方法,但是设置了图片以后没推送出来。

继续查文档,第二种方式:

旧版http,仍然没推送出来。

JSONObject notification = new JSONObject();

notification.put("title", title); // Notification title

notification.put("body", body); // Notification body

notification.put("image",imageUrl);

然后突然有点思路,参考:https://firebase.google.cn/docs/cloud-messaging/android/send-image?hl=zh-cn

使用FCM HTTP v1 API ,新版的协议,仍然没推送出来。

最后客户端做了sdk的升级,

java使用firebase推送带有文字、图片的消息

头像显示出来了,但是是一张大图,合着是小图,展开还是大图。目前没有解决方法。

相关文章:

  • 2022-01-06
  • 2022-01-12
  • 2022-12-23
  • 2021-05-10
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-18
  • 2021-12-06
  • 2021-11-17
  • 2021-12-14
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案