-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Description
Problem:
When navigating away from the 'Scan' scene or in background mode, the camera component remains active + scanning.
Effects:
- drains battery
- scans when the user doesn't expect it
- crashes when returning to the scan scene a second time
Causes:
- React Native Router Flux does not unmount a scene when navigating to a new scene
Possible Fixes:
- Add conditional rendering of the camera which includes the current scene and background mode
- Upsides:
- complete fix
- current best practice
- Downsides:
- requires checking background mode
- must remount on each navigation to the 'Scan' scene, this is slow
- Mitigation:
- Throw up a spinner
- Upsides:
Further Research
- Look into React Native Camera pausing the camera component
- Look into Android Native pausing camera preview
react-native-camera issue 556
react-native-camera issue 460
react-native-camera issue 357
Metadata
Metadata
Assignees
Labels
No labels