Lifecycle and Rollback Safety

Initialize the SDK and mark a successfully rendered bundle as healthy.

Edit

The order is important:

import { useEffect } from 'react';
import { configure } from '@nitropush/react-native';
 
// Module scope: runs before React renders.
const client = configure();
 
export function App() {
  useEffect(() => {
    void client.notifyAppReady();
  }, []);
 
  return <RootNavigator />;
}

notifyAppReady() confirms that the active bundle reached a healthy first render. If a newly installed bundle fails before this signal, NitroPush can restore the previous known-good bundle on the next launch.

Call it from JavaScript only. Do not call it from applicationDidBecomeActive, Android onResume, a splash-screen callback, or any other native lifecycle event: those events can fire before React successfully evaluates and renders the new bundle, which would disable rollback for a broken update.

Do not skip notifyAppReady()

Missing this call makes a healthy update look like a failed boot. Calling it before React renders is worse: it can mark a broken update healthy and cause a persistent boot loop.

After initialization, call sync whenever your product should check for updates.