简体   繁体   中英

How to wake up an app

Is it possible to wake up an app every x minutes, so that the application can do something in the background? So the app stays in the background.

不,iOS SDK不支持此类行为。

This doesn't wake an app up every x minutes, but will launch an app into the background:

An app can be woken by a significant location change, if the app has indicated that it wants to monitor such events.

See: CLLocationManager Docs

Look for a method called startMonitoringSignificantLocationChanges . If a significant location change occurs while your app is not in the foreground or isn't running at all, your application will be launched in the background, allowing the app to perform background-only operations (eg no view code will run).

You cannot wake your app programmatically. You could incorporate push notifications; however, the user would have to opt to open the notification.

No, you can use internal (like reminder) or external (push) notification to to open an app. however, the user would have to opt to open the notification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM