Comments (11)
Hi @Jo2010
I'm writing a more complete documentation to help with ranging and monitoring.
As you monitor
beacons you need to call requestAlwaysAuthorization()
since requestWhenInUseAuthorization()
is not enough.
You already did it.
But in that case you have to add in your info.plist: Privacy - Location Always Usage Description
(see Beacons.requestAlwaysAuthorization()).
Concerning monitoring, I fixed:
- android in
v1.0.2
- iOS in master branch (
npm install --save https://github.com/MacKentoch/react-native-beacons-manager.git
coming soon as v1.0.3)
from react-native-beacons-manager.
Another detail android
specific, ensure to activate location service
in pair with bluetooth
on android 6.
On android 7, things are more simple: just activate bluetooth
.
from react-native-beacons-manager.
@MacKentoch Added Privacy - Location Always Usage Description to info.list, both the location and bluetooth is enabled on android. I just tried using npm install --save https://github.com/MacKentoch/react-native-beacons-manager.git also (Earlier I was using v1.0.2, not v1.0.1. updated original post), but nothing helps. Beacons list is empty. I also tried using two android devices android 5 and android 6, but on both the devices when I debug I see the beacons list is empty. Also, events regionDidEnter and regionDidExit never fired.
Let know whether my understanding below is correct. When the same app using the above sample is installed on both android device and iOS device, on android I'll see beacons list contains one beacon and that beacon identifier will be "Estimotes", and on iOS I'll see beacons list contains one beacon and that beacon identifier will be "Region1". Is that correct?
from react-native-beacons-manager.
Attached screenshots of what I see in the debug in chrome debug.
One iOs Device
(I tried with and without uuid, the below screenshot take without uuid)
from react-native-beacons-manager.
You have a really nice understanding.
In fact I've never seen that strange behaviour.
So it is interesting to study it then fix it (thank you for this issue it will be helpful).
Now lets break into small piece this issue to solve it.
First could you try to just range for beacons and comment startMonitoring:
Beacons.requestAlwaysAuthorization();
// Beacons.startMonitoringForRegion(region);
Beacons.startRangingBeaconsInRegion(region);
Beacons.startUpdatingLocation();
By the way how do you test for example android as a beacon emitter?
I personally use beacon simulator (it is complete: choose any kind of beacons, change the power etc...).
from react-native-beacons-manager.
@MacKentoch Okay, I commented startMonitoringForRegion for both iOS code and android code. I see the same results. Beacons list is empty. So far, I have not used any beacon simulator as I thought if I install the same app in two devices and I can use them as beacon simulator and detector (is that correct?). Just now I tried using beacon simulator that you mentioned and added a beacon and started broadcasting from android device. On my iOS app, below line prints only empty list of beacons with identifier as 'Estimotes'. Please note, I'm not running BeaconsDemo in react-native-beacons-manager, I'm running my app which has the above code. Maybe I made mistakes?
DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
console.log('Found beacons!', data);
});
On beacon simulator , on the scanner, I see three beacons listed, I think those are my neighbours' TV and other beacon enabled devices. On my app, the below code always prints empty beacons list.
DeviceEventEmitter.addListener('beaconsDidRange', (data) => {
console.log('Found beacons!', data);
});
from react-native-beacons-manager.
@MacKentoch Now, my app installed in android is able to detect the beacons coming from beacon simulator installed on another android device and also the beacon coming from beacon simulator installed in my iPad. But still my app running on different devices are not detecting each others as beacons. Why is that? Also, only my app running on android can detect other beacon simulator , but my app running on iOS is still showing empty list of beacons.
When which line of executed on my app, its starts broadcasting as beacons? I beleive for iOS it's the below lines
Beacons.startRangingBeaconsInRegion(region);
Beacons.startUpdatingLocation();
and for android the below line
Beacons.startRangingBeaconsInRegion("Region1");
Correct?
from react-native-beacons-manager.
@Jo2010 Wait I think there is a misunderstanding:
This library does not provide anything to make your app as a beacon emitter.
Beacons.startUpdatingLocation(); // is required for monitoring to get the initial position of the device ≠ does not behave as an emitter
Am I wrong in what you want to do?
from react-native-beacons-manager.
@MacKentoch Oh! Oops! Sorry for my wrong understanding. There is no issue then.
from react-native-beacons-manager.
I faced this error while running in simulator. In real device, the screen shows as blank white screen.
from react-native-beacons-manager.
i am facing similar issue, i am implement the beacon transmission on both android and ios devices and when trying to monitor and range with help of this package, my android device is not listed in iphone and also vice versa.
@MacKentoch any thoughts on this ?
from react-native-beacons-manager.
Related Issues (20)
- Android: No scanning when app is killed HOT 6
- ld: library not found for -lRNiBeacon HOT 1
- Thread 6: signal SIGABRT / use_native_modules! skipped the react-native dependency 'react-native-beacons-manager'. No podspec file was found. HOT 1
- Error in gradle HOT 1
- Android build fails - Could not find method compile() for arguments [directory 'libs'] HOT 3
- Error : App not detecting bluetooth on Android 12 HOT 4
- Execution failed for task ':app:checkDebugDuplicateClasses'. HOT 1
- Could not find method compile() for arguments HOT 2
- Why package needs permission for NSLocationWhenInUseUsageDescription? HOT 1
- Fetch Beacons while app is not running HOT 2
- Fork that works up to RN 69.7 HOT 3
- How detect all iBeacons around me ? HOT 2
- App crashed and i dont know why + stacktrace
- App throws an error after run initial with a minimal example HOT 26
- A problem occurred evaluating project ':react-native-beacons-manager'. HOT 1
- XPC connection invalid HOT 2
- Unable to detect the beacons HOT 9
- Question: Why does the app need authorization right at the start? HOT 1
- beacon detection issue HOT 2
- Could not find org.altbeacon:android-beacon-library HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-beacons-manager.