I created a sample Android app here that calls BackgroundTimer.setInterval with a 10 second interval. Each interval it writes a timestamp to a Redux store and also calls the react-native-ble-plx bluetooth library to scan for devices for 2 seconds, writing the list of devices to Redux which is displayed by the main component.
When the app loses focus, the timestamps continue to be written to the Redux store but the scanning no longer works. Log messages for the scanning show it starting every 10 seconds and stopping after the 2 second setTimeout but no devices are found when the app is in the background.
I created a sample Android app here that calls
BackgroundTimer.setInterval
with a 10 second interval. Each interval it writes a timestamp to a Redux store and also calls the react-native-ble-plx bluetooth library to scan for devices for 2 seconds, writing the list of devices to Redux which is displayed by the main component.When the app loses focus, the timestamps continue to be written to the Redux store but the scanning no longer works. Log messages for the scanning show it starting every 10 seconds and stopping after the 2 second setTimeout but no devices are found when the app is in the background.
index.js
doScan