How can I detect screen lock/unlock events on the iPhone?

Check this out, I wanted to detect the lock/unlock events, I solved it by Darwin notifications. You can detect the event when the device is locked by “com.apple.springboard.lockcomplete”. //call back static void displayStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { // the “com.apple.springboard.lockcomplete” notification will always come after the “com.apple.springboard.lockstate” notification … Read more