Closing the application on the iOS power button is turned off

I am creating an iPad application on iOS5.0. I need to close it if the user is in the application and presses the power off button on the iPad. The user will have to restart the application as soon as he presses the power button. How am I supposed to do this?

Thanks in advance for your help.

+4
source share
3 answers

set this key "Application does not start in the background = NO" in the file App-info.plist

0
source

you can try this ....

UIApplicationExitsOnSuspend for your Info.plist

0
source

You can exit (0) in your delegate's applicationWillResignActive method, but it will kill the application if there is a phone call or something else. And the apple will block it.

0
source

Source: https://habr.com/ru/post/1401100/


All Articles