【问题标题】:Appcelerator iOS Rich Push Notification not showing image when sent through FCMAppcelerator iOS Rich Push Notification 在通过 FCM 发送时不显示图像
【发布时间】:2018-05-08 12:12:24
【问题描述】:

我正在尝试在我的 iOS 应用中发送丰富的通知。我正在使用 FCM 发送通知。下面是here 中提到的有效负载。我正在使用 FCM 模块(https://github.com/hansemannn/titanium-firebase-cloud-messaging)。我指的是this 示例项目,并在我的Titanium 项目中成功添加了UNNotificationServiceExtension。 但这里的问题是,我只收到普通通知,通知面板中看不到图像。

{
    "to": "e4DgI95lsPA:APA91bHFX9MUmJ....",
    "content_available": true,
    "mutable_content": true,
    "click_action": "DOWNLOAD_CONTENT",
    "data": {
        "message": "Offer!",
        "attachment-url": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FloorGoban.JPG/1024px-FloorGoban.JPG"
    },
    "notification": {
        "body": "Enter your message",
        "sound": "default"
    }
}

【问题讨论】:

    标签: ios firebase apple-push-notifications firebase-cloud-messaging appcelerator


    【解决方案1】:

    查看链接的 github 示例的 README: Rich Notifications are part of the Titanium SDK 7.2.0 release

    当前的 SDK 版本是 7.1.1.GA。因此,它仅在您使用夜间构建或自定义 SDK 时才有效

    【讨论】:

    • 你好@miga,我认为 Ti SDK 7.2.0 的 GA 版本需要一些时间才能发布。我们不能用当前的解决方案做任何事情吗?因为我通过上述解决方案获得通知,只是没有在通知中获得图像。我的设置中有什么遗漏或做错了什么吗?提前致谢。
    • 据我了解,您想要的功能(图像)是该版本的一部分,以前不可用。因此,如果您真的需要它,请尝试来自 builds.appcelerator.com 的每晚构建
    • 我能够收到带有上述设置的图像通知。我通过在上述有效负载中指定两个参数"attachment-url": "https://api.buienradar.nl/Image/1.0/RadarMapNL", "attachment-name": "example.png 来实现它。但是当我替换 attachment-url 的 URL 时,我无法收到它。
    猜你喜欢
    • 2021-02-10
    • 2019-05-16
    • 2021-05-04
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    • 1970-01-01
    • 2017-03-05
    • 1970-01-01
    相关资源
    最近更新 更多