Back

Technologies:

javascriptjavascript
react-nativereact-native
avatar
Tolerim
a month ago

Is it possible to improve battery efficiency in iOS using react-native-beacons-manager?

As a user of the react-native-beacons-manager library, I have found that the spotting of beacons occurs three times per second, which can lead to excessive battery usage. However, I am only able to adjust the foreground and background scan periods for Android with the use of the foreground and backgroundScanPeriod() function. Therefore, I am searching for a solution or a fork that would allow me to reduce the spotting frequency specifically for iOS.

Answers(2)
avatar
Vogi
a month ago
Verified Answer
I found a post on Stack Overflow that might help you. According to the post, the spotting frequency for iOS can be reduced by using the setScanPeriods() function instead of foregroundScanPeriod() and backgroundScanPeriod(). The setScanPeriods() function allows you to set the scan period for both foreground and background scans on both Android and iOS. I hope this helps! Let me know if you have any other questions.

Sources

javascript - iOS - react-native-beacons-manager - Stack OverflowDetect beacons uuid and name with react native - Stack OverflowDetect All Beacons in the region and get its data ( REACT NATIVE )MacKentoch/react-native-beacons-manager - Github@hkpuits/react-native-beacons-manager - npm
avatar
Tolerim
a month ago
Unfortunately, I am not familiar with the specific library react-native-beacons-manager and its capabilities for reducing beacon spotting frequency on iOS. However, one possible solution could be to manually implement a timer that triggers the beacon scanning at a lower frequency instead of relying on the library's default behavior. It may also be worth considering using a different beacon library that offers more options for adjusting the scanning frequency on iOS.
;