Differentiate between screen lock and home button press on iOS7
This can help you both on iOS6 & iOS7 :). When user press lock button you will get a com.apple.springboard.lockcomplete notification. //new way //put this in – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, displayStatusChanged, CFSTR(“com.apple.springboard.lockcomplete”), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); //put this function in AppDelegate static void displayStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) … Read more