title: Handling user notifications on iOS 10
body: <p>I have troubles determining when the user taps on a user push notification on iOS 10.</p>
  
  <p>So far, I have been using the <code>-[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]</code> which is called when</p>
  
  <ul>
  <li><code>Case 1</code>: the application is active and the push is received</li>
  <li><code>Case 2</code>: when the user launched the app after taping a received notification</li>
  </ul>
  
  <p>This method comments explicitly say</p>
  
  <blockquote>
    <p>Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented.</p>
  </blockquote>
  
  <p>All this work as expected. </p>
  
  <p>Now iOS 10 deprecated this delegate method and introduced the <code>UserNotification</code> framework which I cannot use because I'm still targeting iOS 8 and 9.</p>
  
  <p>When my app is running on iOS 10 and a push is received while the app is active (<code>Case 1</code>), the <code>-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]</code> is called correctly. </p>
  
  <p>Again on iOS 10, when the user starts the app by tapping a notification (<code>Case 2</code>) this method  <strong>is not called</strong>. </p>
  
  <p>I realise that when I implement the older <code>-[UIApplicationDelegate application:didReceiveRemoteNotification:]</code> it is the one that gets called in the  <code>Case 2</code></p>
  
  <p>On iOS 8 and 9, in the <code>Case 2</code> it is the <code>-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]</code> method is called.</p>
  
  <p>Does it mean that I have to update my application and implement the older delegate just for iOS 10?</p>
  
  <p>So the question is, what is the proper implementation of handling the user interaction of a received push on iOS 10 without using the <code>UserNotification</code> framework.</p>
  
  <p>cheers,
  Jan</p>