1

我目前有一个可以成功与 nodejs 服务器通信的离子应用程序。该应用程序是使用 node-gcm 的通知系统。gcm 的问题是您无法发送图像。如果这样做,则有效负载太大。如果你想发送一张图片,你必须通过像“tumblr.com/.....”这样的网址发送它。我目前不想处理文件系统来托管图像的 url。我想要做的是:1)应用程序获取图像并将图像发布到节点服务器。(base64 或 url 或任何工作)。

2)然后服务器获取该图像并通过 gcm 将其发送到另一台设备

3)其他设备接收到gcm并看到图像。

唯一限制我的是 gcm 的有效载荷。那么如何在不使用文件系统的情况下创建我需要的链接呢?

4

1 回答 1

0

试试下面的json,它对我有用

{"regid": "registratioId whom do you want to send",
    "data": {
        "title": "your title",
        "message": "your message",
        "image": "link of the icon you want to set",  // this will be displayed as icon
        "style": "picture",
        "picture": "link of the picture/image you want to send",
        "summaryText": "summary text"
    }
}
于 2016-10-14T11:44:18.740 回答