IOS: check if the phone is locked

Is there a way to check if the phone is locked? Or am I getting a notification that the phone is locked?

My application runs in the background, continues to play audio, so applicationWillResignActive: in fact, this is not what I'm looking for.

+4
source share
2 answers

You cannot, right. Indirectly, you can view accelerometer enable / disable notifications .

Why do you want to detect this event in the first place?

+2
source

Checkout UIApplicationProtectedDataWillBecomeUnavailable. This appears to be called when the device is locked. IOS4 + only.

UIApplicationProtectedDataWillBecomeUnavailable

http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html

+5
source

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


All Articles