是否可以使用firebase推送通知通过通知发送可点击图像,如果是,我应该从哪里开始学习如何操作?
答案 0 :(得分:0)
if (remoteMessage.getData().size() > 0) {
Log.d(TAG, "Message data payload: " + remoteMessage.getData());
Jsonobject obj=new JsonObject(remoteMessage.getData());
String image=obj.getString(“image_base64_string”);
//which you have to send from your backend or firebase console using this key
//then decode this image to bitmap and setimage to the imageview
}
// Check if message contains a notification payload.
if (remoteMessage.getNotification() != null) {
Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
}
答案 1 :(得分:0)
是的,您可以在通知有效负载中发送"click_action" => "http://google.com"
,以便在用户点击收到的通知后点击通知上的click_action以及您要重定向的位置