How to detect when a React Native app is opened? : <p>My React Native app wants to synchronize its local data with an API when the user opens the app. This should happen whenever the user returns to the app, not just when it first starts. Essentially, what I would like is the equivalent of AppDelegate's <code>applicationDidBecomeActive</code> callback, so that I can run synchronization code there. Obviously, I would like to do this in React Native instead.</p>

<p>As far as I can tell, the <code>componentWillMount</code> / <code>componentDidMount</code> callbacks on the root component only run when the app is initially loaded, not after the user leaves the app and comes back later (without explicitly quitting the app).</p>

<p>I thought that the <code>AppState</code> API would provide this functionality, but its <code>change</code> listeners don't fire in this case, either.</p>

<p>This seems like obvious functionality to have, so I must be missing something glaringly obvious. Help!</p>
