Background Behavior
react-native-voice-activator does not claim always-on voice behavior. Background support is platform-constrained and must be interpreted narrowly.
iOS
Supported today:
- detection can continue after explicit activation when the host app enters the background and the app declares
UIBackgroundModeswithaudio - the public runtime remains
runningwhile background continuation is still valid - if background continuation is active,
getStatus()keepsisListening: true
Not supported:
- force-quit continuation
- cold relaunch continuation
- pretending background wake word detection survives app termination
Explicit unsupported behavior:
- if the app enters the background without the required iOS audio background mode, the runtime transitions to
unsupported - the runtime surfaces a normalized
platformerror with codebackground_audio_mode_required - the engine-backed detector is torn down so the package does not report
unsupportedwhile detection is still running internally
Foreground return:
- when the app returns to the foreground from a supported background audio state, the runtime remains
running - the package emits a visible runtime update so event-driven consumers do not need to poll
getStatus()to notice the transition - supported iOS audio-session interruptions transition the runtime to
interruptedand, when resumable, back torunningwithout requiring undocumented manual re-arming - non-resumable iOS interruptions surface explicit
unsupportedorerroroutcomes instead of pretending detection continued - supported iOS audio-route changes emit
audioRouteChangedevents so apps can react to route movement without polling
Android
Supported today:
- detection can continue after explicit activation when it is started from a visible Android activity context
- the runtime remains
runningwhile the foreground-service notification is active - if Android foreground-service continuation is active,
getStatus()keepsisListening: true
Not supported:
- starting detection from a hidden or background-only app context
- implying Android background behavior is exempt from OEM battery management or device policy differences
- claiming parity with the current iOS audio-background model
Explicit unsupported behavior:
- if detection is started without a visible activity context, the runtime transitions to
unsupported - the runtime surfaces a normalized
platformerror with codeforeground_service_visible_context_required - the runtime tears down service ownership and engine activity so the package does not report
unsupportedwhile the detector is still running internally
Permission and notification requirements:
- Android background continuation requires
RECORD_AUDIO - the package also requires foreground-service permissions and an active foreground-service notification while detection is running
- if microphone permission is missing, the runtime surfaces a normalized
permissionerror instead of pretending background continuation is available - supported Android audio-device topology changes emit
audioRouteChangedevents through the shared JS contract - interruption and service/runtime recovery still require device validation before the package should claim production-proven Android resilience
Developer Guidance
- treat
getStatus()and runtime events as the source of truth for supported versus unsupported behavior - keep user-facing messaging explicit about force-quit and relaunch limitations
- keep docs and app copy explicit that the built-in Sherpa engine is still constrained by the same platform lifecycle limits
- do not market this package as “always on like Siri”