OK, When you lock your screen/iPhone goes to sleep mode, the front most app(Your app) will go to background mode, and when you pull down the Notification Center, you app actually is not pushed to background.
So, you can use
- (void)applicationWillEnterForeground:(UIApplication *)application
or
- (void)applicationDidEnterBackground:(UIApplication *)application
to set a value, say bgFlag
, in your app delegate class,
then, when - (void)applicationDidBecomeActive:(UIApplication *)application
is invoked, you check whether bgFlag
is set or not.
Good luck.