Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When an iOS app directly enters the background state?

Can someone tell me a scenario when an iOS application directly enters the background state?.

Here I have quoted the lines from iOS Application Programming Document in multitasking section.

If your app is launched into the background instead—usually to handle some type of background event—the launch cycle changes slightly to the one shown in Figure 3-3. The main difference is that instead of your app being made active, it enters the background state to handle the event and then is suspended shortly afterward.

Added ...

In the iOS Application Programming Document if you see the figure 3.3 titled Launching an app into the background, the flow is like this User taps app icon -> main() -> UIApplicationMain() -> Enter background. Is there any chance when the app directly enters background when an user taps app icon. I interpreted the image like this. Is it correct?

Thanks.

like image 804
durai Avatar asked Oct 15 '25 19:10

durai


1 Answers

One scenario for a background launch (App X)

  • X registered for location background mode in its Info.plist
  • X is run by the user, and registers for significant location changes while running
  • The user switches to another app Y, so X goes to background and is then suspended (it will be returned to background mode whenever there is a significant location change to handle, and then be suspended again)
  • The app Y eats lots of memory, so suspended applications (including X) get kicked out of memory
  • a significant location change comes in. Now X is launched into background.
like image 155
Tammo Freese Avatar answered Oct 17 '25 10:10

Tammo Freese



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!