@shopgate/native-modules is the library that gives the app’s web layer access to
native device and platform capabilities — camera, push, geolocation, secure storage,
analytics SDKs, and system UI. Each capability is exposed as its own module with a
small, promise-based API, so the web code can call native functionality as if it were
a normal async function.
Promise-based. Every method returns a Promise. Call them from React event
handlers or effects with async/await.
Import per module. Import only what you need from @shopgate/native-modules.
Each module is a named export (Camera, Push, StatusBar, …).
Events. Modules that push state to the web layer expose
addEventListener(name, handler) / removeEventListener(name, handler). Register
in a useEffect and clean up on unmount. Examples: connectivity changes, incoming
push, deep links, in-app-browser open/close, Braze card updates.
Platform differences. Some methods are platform-specific. Android-only calls
(e.g. the Android navigation bar) resolve to undefined on iOS; a few options are
iOS- or Android-only and are marked as such on the module page.
Real-device features. Camera, brightness, and similar hardware features require
a real device — simulator behaviour may differ.