【问题标题】:Receive Push notification in iOS when the application is in terminated state当应用程序处于终止状态时在 iOS 中接收推送通知
【发布时间】:2017-08-01 23:15:30
【问题描述】:

我已经为我的 Android 和 iOS 应用程序实现了 Firebase Cloud 消息传递。

我在 FCM 请求负载 中使用 data 键,该键仅在应用处于后台或运行状态时显示通知。当应用程序处于终止状态时,不会收到通知。

然而,当我在 FCM 请求负载 中使用 notification 键时,即使在终止状态下我也会收到通知。

使用数据键的原因是为了修改动作的处理,呈现方式。在 Android 应用中,我自定义了通知的行为,如振动、声音等。

我想在 iOS 中做同样的事情。

现在,如果两个密钥都在请求负载中传递,默认情况下,通知密钥由两个操作系统处理。

【问题讨论】:

    标签: ios push-notification swift3 apple-push-notifications firebase-cloud-messaging


    【解决方案1】:

    当应用程序终止时,iOS 设备无法接收data-messages
    这是 iOS 的一个限制,所以 firebase-messaging 无法真正解决它。

    【讨论】:

    • 只是 firebase 吗?或者我们也不能在原生 APNS 中做到这一点?
    • 如果您只需要更改演示文稿,请检查 mutable-content 选项
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-19
    • 2016-05-05
    相关资源
    最近更新 更多