前端时间,印度的应用,增加了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/do