首页 > 解决方案 > Appcelerator iOS Rich Push Notification 在通过 FCM 发送时不显示图像

问题描述

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

{
    "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"
    }
}

标签: iosfirebaseapple-push-notificationsfirebase-cloud-messagingappcelerator

解决方案


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

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


推荐阅读