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?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- Popover segue to static cell UITableView causes co
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
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.
You can have your app schedule push notifications, but you can't schedule it to run specific code unless it's running.