cordova - IBM mobile First 8.0 中带有图像的促销推送通知
问题描述
我们正在开发混合移动应用程序,(IBM Mobilefirst8.0,IONIC3.0,Angular4.0),我们正在尝试发送促销推送通知(带有图像的推送通知),我们能够发送带有文本但无法获取图像的推送通知,
我们在下面尝试了什么:
{
"message":{
"alert":"Picture Notification from MFP console ",
"url":"http://www.sfshjdf.com"
},
"priority" : "high"
"target":{
"userIds": ["MyUserId", ...]
},
"settings":{
"gcm":{
"style":{
"notification_type":"PICTURE_NOTIFICATION",
"url":"https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
"title":"Test Picture Notification"
},
"apns": {
"attachmentUrl" : "https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
"payload" : {
"title": "test Sampele",
"url": "https://www.gsdfh.com"
}
}
}
}
}
我们得到了什么:
我们收到短信"Picture Notification from MFP console"
,但图像未显示在通知消息中。我们期待通过图像通知我们在“设置”选项中传递的内容。如果有人指导我们,我们错过了什么
解决方案
用于发送通知的有效负载不正确。这是要发送的正确有效负载结构,
{
"message":{
"alert":"Picture Notification from MFP console ",
"url":"http://www.sfshjdf.com"
},
"target": {
"userIds": ["MyUserId", ...]
},
"settings":{
"gcm":{
"style":{
"notification_type":"PICTURE_NOTIFICATION",
"url":"https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
"title":"Test Picture Notification"
},
},
"apns": {
"attachmentUrl" : "https://theidealmobile.com/wp-content/uploads/2018/09/42720897530_f34f7247cc_b.jpg",
"payload" : {
"title": "test Sampele",
"url": "https://www.gsdfh.com"
}
}
}
}
请尝试上面的有效载荷 JSON。谢谢。
推荐阅读
- javascript - NextJS getInitialProps
- python - SpriteCollide 每次碰撞只运行一次
- angular - 在 Angular Overlay 上动态更改 ElementRef 以重新定位它?
- javascript - 尝试在页面中创建“div”选择器:JavaScript TypeError
- php - 如何仅显示数据库中 user_id 与 Laravel 中的当前用户相同的不同数据
- python - Python Plotly - 为什么 2 个曲面图显示不同的结果?
- reactjs - Redux Toolkit 中的自定义中间件
- c - C中矩阵动态分配的模块化
- c - Revealer 在活动时隐藏另一个 Revealer (gtk_tree_store) - GTK3 , C
- html - ffmpeg 流桌面代替 -i /dev/video0