Is it possible to have my closed app run code in i

2020-03-24 06:39发布

Let's say that my app in iOS is closed. Would it be possible to set it up so that it runs a piece of its code after a certain period of time?

标签: iphone ios ios5
3条回答
我只想做你的唯一
2楼-- · 2020-03-24 07:15

iOS allows background processing for the following reasons: - location dependent functionality - background audio playback - voip

You can find out more from Apple's multitasking documentation

查看更多
兄弟一词,经得起流年.
3楼-- · 2020-03-24 07:18

Short answer: no, you can not. At the most, your application will keep running in the background for 11 minutes, if you request the extra time (check the documentation for beginBackgroundTaskWithExpirationHandler on the UIApplication class). There are some things you can do: Schedule a local notification, which the user can use to launch the app, or use push notifications to remind the user of something he needs to know.

查看更多
家丑人穷心不美
4楼-- · 2020-03-24 07:29

You can have your app schedule push notifications, but you can't schedule it to run specific code unless it's running.

查看更多
登录 后发表回答