Device APIs and Native Capabilities
Native capability work is where React Native teams discover whether their architecture is disciplined. Device integrations should be wrapped behind stable app-owned interfaces instead of leaking platform specifics throughout feature code.
Typical capability areas
- Camera and media library access.
- Location and geofencing.
- Push notifications.
- Secure storage and keychain access.
- Biometric authentication.
- Background tasks and sync.
- File access and sharing.
Permission strategy
Permission handling should be intentional:
- Explain why the app needs the capability before requesting it.
- Request as late as possible while preserving user context.
- Handle denial and restricted states gracefully.
- Document platform differences in copy and fallback behavior.
Never let raw permission requests scatter across screens.
App-owned integration layer
Create wrappers such as:
notificationsServicecameraServicesecureStorelocationService
This keeps third-party dependencies and native implementation details behind a stable API that product features can consume safely.
When to write a native module
Write native code when:
- There is no dependable library for the capability.
- Performance or threading behavior must be controlled directly.
- You need to bridge a proprietary SDK.
- The product depends on platform APIs not exposed by your current stack.
Background work
Background execution is heavily constrained on mobile platforms. Document:
- Which tasks must run in the background.
- Which guarantees actually exist.
- Battery and network expectations.
- Recovery logic if the task is delayed or canceled by the OS.
Assume the operating system is allowed to say no.
Security considerations
Device capability work often touches sensitive data. Standardize:
- Secure storage boundaries.
- Redaction rules in logs.
- Media handling and upload policies.
- Token storage and rotation.
Testing requirements
Every native capability needs:
- One happy-path test.
- Denied-permission behavior validation.
- Error handling coverage.
- Real-device validation when simulators are not sufficient.
Team rule
Feature code should ask for a capability from your app layer, not from a third-party SDK directly. That rule keeps upgrades and replacements manageable.
Next, improve performance.