title: how to detect user clicked iOS remote notification?
body: <p>When user taps on a remote notification, the following callback is triggered in the app delegate:</p>
  
  <p><code>-application:didReceiveRemoteNotification:fetchCompletionHandler:</code> </p>
  
  <p>in this scenario, application is launched and the app state is <code>UIApplicationStateActive</code> which I interpret it as user actioned on a remote notification.</p>
  
  <p><strong>the problem:</strong> 
  This method can also get called when a remote notification arrives and app is in the foreground <strong>with inactive state</strong>.</p>
  
  <p><strong><em>example</em></strong>: when notification center view is open(swipe from top edge of screen down) or a UIAlert is open. In both case application state is <code>UIApplicationStateActive</code> and there is no way to tell whether it's a user actioned notification or system push received. </p>
  
  <p><strong>Q</strong>: How can I determine if <code>didReceiveRemoteNotification</code> callback is response to user tapping on remote notification vs arrival of remote notification?</p>