[英]iOS app to run continuously in background
I want my iOS apps to run continuously in background 24/7 I tried many options like background location updated with background task expiration handler, but later after some times it seems that the application gets suspended in background and user is brought back to the root view controller.我希望我的 iOS 应用程序在后台 24/7 连续运行我尝试了许多选项,例如使用后台任务到期处理程序更新的后台位置,但过了一段时间后,似乎应用程序在后台暂停并且用户被带回根视图控制器。 Any help will be appreciated.
任何帮助将不胜感激。
You should read this page of Apple Programming Guide : Background Execution您应该阅读 Apple Programming Guide 的这一页: 后台执行
It is not allowed to run background tasks 24/7.不允许 24/7 全天候运行后台任务。 But you can use many different ways.
但是您可以使用许多不同的方式。
For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended.对于需要更多执行时间来实现的任务,您必须请求特定权限才能在后台运行它们而不会被挂起。 In iOS, only specific app types are allowed to run in the background:
在 iOS 中,只允许特定类型的应用程序在后台运行:
Declaring the services lets the system know which services you use, but in some cases it is the system frameworks that actually prevent your application from being suspended.声明服务让系统知道您使用了哪些服务,但在某些情况下,实际上是系统框架阻止了您的应用程序被挂起。
You simply can't.你根本做不到。 Apple don't give any mean for an app to ensure background execution.
Apple 没有为应用程序提供任何手段来确保后台执行。 iOS will give you processing time whenever it feel like it, and you cannot control that.
iOS 会随时为您提供处理时间,而您无法控制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.