react-native-beacons-manager
react-native-beacons-manager copied to clipboard
Add Android RSSI filter customization method
Hi, great job with this library, any plan to introduce the Android's setSampleExpirationMilliseconds
method? I think it's just 3 lines of code but could be very useful to enhance the experience during BLE based navigation.
I can fork and implement, even if i'm not an experienced Android dev if you think it could be useful.
I implemented more general RSSI filter choice, also with averaging period customization. Branched it in https://github.com/peterdeka/react-native-beacons-manager/tree/setfilter tested working (maybe we could use some parameter validation based on filter type). I currently branched from the latest release, but applying to current HEAD implies only copy/pasting the android java module and adding typing to the android js lib file.
Nice could you please submit a PR?
Could you publish a new version that includes this change?
Testing this functionality added to the current release (not master HEAD) breaks the iOS build for the way i exported the constants for the filter types.
The relative code is in lib/module.android.js
:
const ARMA_RSSI_FILTER=beaconsAndroid.ARMA_RSSI_FILTER;
const RUNNING_AVG_RSSI_FILTER=beaconsAndroid.RUNNING_AVG_RSSI_FILTER;
When building on iOS the constants are not exported from the android code and the js code fails at runtime.
As i'm no expert of ReactNative, do you think the best solution is hardcoding the same values as those defined in the android code or is there a more elegant way? I can do that and PR if you give me advice.