ios - didReceiveNotificationRequest :withContentHandler - execution time limit?

标签 ios swift ios10 serviceextension

UNNotificationServiceExtension有一个方法 didReceiveNotificationRequest:withContentHandler处理通知更改。

它有一个非常模糊的描述,关于超时时间:

That method has a limited amount of time to perform its task and execute the provided completion block. If your method does not finish in time,

这是对 serviceExtensionTimeWillExpire 的描述方法:

If your didReceiveNotificationRequest:withContentHandler: method takes to long to execute its completion block, the system calls this method on a separate thread to give you one last chance to execute the block.

我不完全明白,“to long to execute”是什么意思。 它有任何定量数据吗?它是否因运行的设备等而异?

谢谢!

最佳答案

https://developer.apple.com/reference/usernotifications/unnotificationserviceextension/1648229-didreceivenotificationrequest?language=objc#discussion

取自上面链接的 Apple 文档。

您的扩展有有限的时间(不超过 30 秒) 修改内容和执行 contentHandler block 。

关于ios - didReceiveNotificationRequest :withContentHandler - execution time limit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39123351/

相关文章:

swift - 子类结构或类似

ios - Xcode 8,iOS 10 - "Starting WebFilter logging for process"

Swift 3 - 原子 boolean 值

ios - 滑动方向 PageViewController

ios - 构建 Unity 项目后如何修复 Xcode 中的 "Undefined symbols for architecture arm64:"错误?

ios - 如何在出现键盘时向上移动两个 UIView?

ios - 将 UIButton 添加到工具栏 swift 5

ios - Xcode - 您的帐户中没有注册任何设备 - 解决方法?

ios - 如何为 ionic 框架编写自定义/自己的插件

swift - 如何在 SQLite FTS5 中突出显示前缀匹配