Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling phone shut down event in iOS [duplicate]

Tags:

ios

I was wondering if I can be able to detect when the user turns off the phone. Is it possible? Does apple allow it? If they do, how? Thanks.

like image 564
teach Avatar asked Nov 28 '25 13:11

teach


1 Answers

As shutting down the device is an external event and has nothing to do with your app, you won't be able to find out if the user is trying to turn it off. The only thing you can actually find out is when your application is going to enter the background, what does not necessarily mean that the user turns the device off.

Checkout UIApplication Delegate Ref

like image 199
croX Avatar answered Dec 01 '25 04:12

croX