Force app to close and run in background

ε祈祈猫儿з 提交于 2019-11-28 14:10:26

You can force an iOS app into the background by sending a registered URL to another app to handle, such as a web site URL to Safari.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: myWebsiteURL ]];

Many many apps that call Safari to handle URLs are approved by Apple.

To get any time in the background, an app has to be appropriately configured using one of the allowed background modes (audio, location or VOIP); or the app can request a few minutes of extra time in the background before being suspended by calling the beginBackgroundTaskWithExpirationHandler method

You can't have a process running (doing work) in the background in iOS, you get a few seconds when the app quits to do any clean up and that's it!

You cannot force an application into the background, I'm fairly sure that Apple's guidelines prohibit you from doing that. What could your app possibly be doing that it can only do in the background and not in the foreground?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!