gpt4 book ai didi

ios - 即使 didReceiveRemoteNotifications 没有被 iOS 调用,静默通知是否会像普通通知一样显示

转载 作者:行者123 更新时间:2023-11-29 11:51:42 25 4
gpt4 key购买 nike

  • 现在,我的 iOS 应用会收到正常(非静默)的推送通知。
  • iOS 设备按预期显示通知。

  • 现在,我想通过添加 "content-available=1" 以及所有其他用户可见键将普通通知转换为静默通知。

  • 能够在通知触发器上执行 bg 任务

我的理解是 iOS 可能不会总是调用 didReceiveRemoteNotifications 来获得静默通知。

我的问题是,即使 iOS 决定不调用 didReceiveRemoteNotifications

,iOS 也会显示静默通知(如果它包含用户可见键)

我的期望是静默通知应该像正常通知一样工作,并且 didReceiveRemoteNotifications 的优势是在可能的时候被调用(尽力而为)

我不想因为切换到静默通知而失去正常的通知行为。

最佳答案

根据 this link

For a silent notification, take care to ensure there is no alert, sound, or badge payload in the aps dictionary. If you don’t follow this guidance, the incorrectly-configured notification might be throttled and not delivered to the app in the background, and instead of being silent is displayed to the user

因此,如果添加了 alert、sound 和 badge 键,则该通知将像普通推送通知一样显示。

关于ios - 即使 didReceiveRemoteNotifications 没有被 iOS 调用,静默通知是否会像普通通知一样显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40831728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com