title: Detect whether React Native iOS app was opened via push notification
body: <p><a href="https://stackoverflow.com/questions/16393673/detect-if-the-app-was-launched-opened-from-a-push-notification">Detect if the app was launched/opened from a push notification</a> describes how to detect whether a native iOS app was opened (that is, either launched or merely made active) via the user tapping a push notification.</p>
  
  <p>How can I do the same thing in React Native? <a href="https://facebook.github.io/react-native/docs/pushnotificationios.html" rel="noreferrer"><code>PushNotificationIOS</code></a> lets me attach a notification listener...</p>
  
  <pre><code>PushNotificationIOS.addEventListener('notification', function (notification) {
      console.log('got a notification', notification);
  });
  </code></pre>
  
  <p>but this fires both when a push notification is received with the application in the foreground, <em>and</em> when I open the app via a push notification.</p>
  
  <p>How can I detect the second case in particular?</p>