[Feature Request]: Expose beacon scanning interval and duration so it can be set per app
Summary
I need to be able to set the scanning interval and duration in my app. The app uses beacons to detect where the user is and I've found that the frequency is too low for my app to work as intended on Android. In an older Xamarin.iOS app that uses the native support for beacons the frequency is much better and I'll check how well Shiny.Beacons work on iOS.
API Changes
Expose ScanInterval and ScanDuration configurations.
Intended Use Case
In apps that needs higher frequency of beacon updates to be able to give the user relevant information when at certain spots.
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Duration is easy to control with RX. I just have a scan, nothing that cycles it on/off every X seconds In terms of frequency of beacon ranging, it is using a balanced scan but I'll look into making this available in a future version.
Ok. I had a look at the code and as you say, I couldn't find anything regarding intervals. I saw that the scan mode is Balanced and that there's a mode called LowLatency. Would that be a way to increase the scanning frequency?
I'm visually impaired and I use TalkBack on Android and I let the MAUI app announce the id of each beacon as it was ranged and it was quite infrequent. It could be more than a handful seconds between rangings of beacon A while beacon B was announced a couple of times in between. Perhaps this is due to how Android is designed without posibillity to change it. I ran the same app on my iPhone and it was like a clockwork that makes the detection of beacons a breeze.
Could you explain what you mean by controlling duration with Rx=
Do you think it would make any difference changing the duration via RX? Could you point to an example where I can see how to set the RX so I can try it out? Is it possible to set the mode to Low latency or do you have to make changes in the library in order to make that work?
There is no way to control the scan options available which requires an update to the library.
If you're looking to control intervals, you can use a simple timer (or Observable.Interval) to toggle between start stops. I'm not really sure exactly what you're looking to do, but the reactive documentation is here: https://reactivex.io/documentation
I would encourage you to take a look through the library code to understand it especially if you intend to consume it in an app.
What I'm aiming at is to get more frequent updates from the beacons. In iOS you get updates each second but with Shiny Beacons on Android it's quite iregular. Sometimes it takes a handful seconds between the updates which make it harder to use in the scenarios my app is intended for. If it isn't possible to ramp up the updates from the underlying system (regardless of library used, Shiny Beacons or other ones) then I'd greatful for that knowledge. If it's a limitation of Shiny Beacons that would also be very helpful to know so I can consider if it's worth the effort to find a different library. Thanks for your help.