android - 如何使用firebase在android中的通知中发送图像?
问题描述
我正在尝试从 firebase 控制台以推送通知的形式发送图像,但它不起作用,所以我尝试从邮递员发送,但它也不起作用。我在正文中尝试了来自 Internet 的其他参数,例如图标、图像、media_url、mediaImgUrl..等。
在这里帮助我,以便我可以在通知中发送图像。
{
"to": "tokennnnnnnnnnnn............",
"content_available": true,
"mutable_content": true,
"data":
{
"message": "Hey!",
"icon": ".....farm.png"
},
"notification":
{
"body": "Topic",
"sound": "default",
"icon": ".....farm.png"
}
}
解决方案
尝试使用此有效负载发送图像:
{
"message":{
"token" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"android": {
"notification": {
"body" : "This is an FCM notification that displays an image.!",
"title" : "FCM Notification",
"image": "url-to-image"
}
}
}
推荐阅读
- java - 除了 String 之外,哪些内置 Java 类使用池化?
- vb.net - 如何删除数据网格中的选定行?使用 vb.net 和 ms 访问
- jetbrains-ide - JetBrains IDE 如何配置多语言文件
- php - 我可以在 Class 构造函数中定义一个对象吗?
- numpy - train_test_split 在使用(大)numpy 数组时崩溃 RAM
- r - 从粗坐标网格到精细坐标网格的插值
- java - 容器(JFrame)到位图
- ios - 使用聚类时无法显示自定义标记
- apache-spark - spark sql:只有非空值的结构或空结构
- json - 如何在 mulesoft 中处理 json 字符串中的转义序列