If your application is already running, you will receive this delegate message in the application delegate
application:didReceiveLocalNotification:
If it was not running, you will have to use
application:didFinishLaunchingWithOptions:
You need to answer accordingly in both methods to cover all cases.
UPDATED
To determine if a user has activated an action button, it takes a little harder. We can say that application:didFinishLaunchingWithOptions: will have a local notification as a launch option, but it is more complicated with application:didReceiveLocalNotification:
Since the application becomes active after the user clicks the button, we must delay until we see this message (or not). Set NSTimer to application:didReceiveLocalNotification and application:didReceiveLocalNotification it in didBecomeActive . This means that the user clicked the action button. If the timer is not canceled, the user was inside the application when it was started.
Jason harwig
source share