【问题标题】:Are silent notifications received with background notifications turned off, while application is running in iOS?当应用程序在 iOS 中运行时,是否在关闭后台通知的情况下收到静默通知?
【发布时间】:2020-04-27 13:33:07
【问题描述】:

我刚刚看了Is Silent Remote Notifications possible if user has disabled push for the app?

它基本上说静默通知忽略用户的通知设置。然后它说:

用户仍然可以关闭您应用的以下功能 通过“后台应用刷新”处理“静默推送” 控制。即使 Apple 推送通知服务 (APN) 将 将标记为“内容可用”的推送发送到您的手机,操作系统将 不唤醒您的应用程序来接收它,有效地将其放在 地板。

这让我很困惑。我只想在应用程序打开时发出静默通知,以便仅在使用时更新应用程序的状态。所以我不在乎后台应用刷新是否关闭,因为我不需要“唤醒 [我的] 应用来接收它”。

其次,Silent push notifications only delivered if device is charging and/or app is foreground 谈到需要让您的手机接通电源才能接收这些通知。

这两个问题都来自 iOS 8,这已经是很久以前的事了。他们一直坚持吗?

【问题讨论】:

    标签: ios push-notification silent-notification


    【解决方案1】:

    我的答案是基于观察和我对苹果通知的工作。 iOS 13 之前

    • 即使通知被用户强行杀死,即使background app refresh is on 也不会收到静默通知。在前台、后台或被 iOS 杀死的情况下收到静默推送

    iOS 13 之后

    • 如果background app refresh is on 总是收到静默通知。但如果background app refresh is off 静默推送仅在前台和后台情况下收到。

    如果您只想在前台或后台发送静默推送,则不应在 Xcode 中添加 background mode 功能。所以它只会在应用程序处于前台或后台时接收

    【讨论】:

    • 我有点搞不懂background app refresh 是什么意思?那会是 ``` UIBackgroundModesfetch ``` 获取模式吗?在UIBackgroundModes 上?
    猜你喜欢
    • 1970-01-01
    • 2021-05-01
    • 2015-03-16
    • 2012-01-28
    • 1970-01-01
    • 2012-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多