Is there a way to check if the phone is locked? Or do I receive a notification of the phone is going to be locked?
My app runs in the background, continues to play audio, so applicationWillResignActive: isn't really what I am looking for.
Checkout UIApplicationProtectedDataWillBecomeUnavailable. This appears to be called when the device is locked. iOS4 + only.
UIApplicationProtectedDataWillBecomeUnavailable
You can't, directly. Indirectly, you can watch for accelerometer on/off notifications.
Why do you want to detect this event in the first place?