首页 > 解决方案 > 如何在 MFP 的推送通知中发送宣传图片

问题描述

如何在推送通知中发送促销图片,如下图所示?我需要在有效负载中使用任何 html 代码吗?如果可能,请分享代码片段。

像这样.

标签: push-notificationapple-push-notificationsibm-mobilefirstworklight-serverworklight-runtime

解决方案


我收到错误“错误请求 - 'gcm' 处的 JSON 验证失败。” 具有以下 JSON 有效负载:-

{
  "settings": {
    "gcm": {
        "payload": {
          "action": "ACTION",
          "path": "/path"
        },
        "style":{  
            "notification_type":"PICTURE_NOTIFICATION",
            "url":"https://homepages.cae.wisc.edu/~ece533/images/airplane.png",
            "title":"RICH PUSH"
         }
    },
    "apns": {
      "payload": {
          "action": "ACTION",
          "path": "/path"
        }
    }
  },
  "message": {
    "alert": "Test MFP PUSH Notification."
  },
  "target": {
    "userIds" : ["11359164"]
  }
}

响应 JSON:-

{
    "code": "FPWSE0011E",`enter code here`
    "message": "Bad Request - The JSON validation failed at 'gcm'."
}

我正在使用 MFP 8.0,请建议对上述 JSON 进行更改。


推荐阅读