react-native-beacons-manager
react-native-beacons-manager copied to clipboard
detectCustomBeaconLayout() expects number, not string
Version
1.0.7 and 1.1.0
Platform
Android
OS version
android 5.1 and 9
Steps to reproduce
- Beacons.detectCustomBeaconLayout('m:0-1=CCCC,i:2-10,p:11-11,d:12-12');
- Beacons.detectAltBeacons();
- Beacons.detectEstimotes();
Expected behavior
Does not complain about wrong type (should expect string with the template?) and should show the correct beacon
Actual behavior
It complains about string being passed. Tried numbers (such as 13) as the size of my message, but it shows an iBeacon from my neighbour.
So, I tried to change the file typings/react-native-beacons-manager.d.ts with: detectCustomBeaconLayout( parser: string ): void;
Then it stopped complain, passed the template I need, builds ok on Android Studio, but keep showing the same neighbour iBeacon device.
Then I tried to use all other types, for my surprise, they also only returns the iBeacon!! No Estimotes, no AltBeacons, no Custom...
Please see the log I made below: ` Correct iBeacon layout: Found beacons, layout m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24 data: Array [ Object { "distance": 34.85527591614393, "major": 17389, "minor": 2198, "proximity": "far", "rssi": -94, "uuid": "50765cb7-d9ea-4e21-99a4-fa879613a492", }, ]
Then I tried to pass a BROKEN iBeacon layout, but still WORKS
incorrect iBeacon layout: Found beacons, layout m:0-3=4cA00215,i:4-19,i:20-21,i:22-23,p:24-24 data: Array [ Object { "distance": 50.7288634831964, "major": 17389, "minor": 2198, "proximity": "far", "rssi": -100, "uuid": "50765cb7-d9ea-4e21-99a4-fa879613a492", }, ] Found beacons, layout m:0-3=4cA00215,i:4-19,i:20-21,i:22-23,p:24-24 data: Array [ Object { "distance": 44.126620660525674, "major": 17389, "minor": 2198, "proximity": "far", "rssi": -93, "uuid": "50765cb7-d9ea-4e21-99a4-fa879613a492", }, ]
our layout: Beacons found, layout: m:0-1=CCCC,i:2-10,p:11-11,d:12-12 data2: Array [] Beacons found, layout: m:0-1=CCCC,i:2-10,p:11-11,d:12-12 data2: Array [ Object { "distance": 35.790052077682994, "major": 17389, "minor": 2198, "proximity": "far", "rssi": -97, "uuid": "50765cb7-d9ea-4e21-99a4-fa879613a492", }, ] Beacons found, layout: m:0-1=CCCC,i:2-10,p:11-11,d:12-12 data2: Array [ Object { "distance": 36.084579889775426, "major": 17389, "minor": 2198, "proximity": "far", "rssi": -98, "uuid": "50765cb7-d9ea-4e21-99a4-fa879613a492", }, ] `
Any ideas?? My project I started with expo, developed all UI, then ejected to expokit, I run expo start, then I go to Android Studio and build there. Everything in the App works ok but that. Doesn't matter what I try with the library, I only receive iBeacons... Below an image of my beacon, that was scanned with a generic BLE app:
Thanks!