简体   繁体   中英

Relaunching app due to Significant Location Change

I am monitoring Significant Location Changes (SLC) even when the app is not in the foreground. It is working as expected and the app is woken up even when it is not running to handle the SLC. However, I would like to understand better how relaunching the app actually happens, name I would like to know what happens in the following scenario:

  1. The app is not running
  2. SLC happens and the app is relaunched. According to the docs: "At wake-up time, the app is put into the background and you are given a small amount of time (around 10 seconds) to manually restart location services and process the location data." Evrything is OK.
  3. While step 2 happens (ie within the time frame the app is running in the background) the user launches the app manually.

What happens in this case?

  1. Will the app simply brought in the foreground?
  2. Will a new instance be launched and application:didFinishLaunchingWithOptions: called without launchOptions?
  3. Will the backgrounded app instance be terminated and a new instance be launched without launchOptions?
  4. Something else?

Thanks for helping me understand this in advance.

There can be only an instance of the application so #2 is out of the question.

Since the app is already running (background mode), the applicationDidBecomeActive will be called

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