Giter VIP home page Giter VIP logo

Comments (11)

MacKentoch avatar MacKentoch commented on August 16, 2024

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.

MacKentoch avatar MacKentoch commented on August 16, 2024

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.

 avatar commented on August 16, 2024

@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.

 avatar commented on August 16, 2024

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)
screen shot 2017-03-19 at 11 40 58 pm

On Android Device
screen shot 2017-03-19 at 11 44 30 pm

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on August 16, 2024

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.

 avatar commented on August 16, 2024

@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.

 avatar commented on August 16, 2024

@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.

MacKentoch avatar MacKentoch commented on August 16, 2024

@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.

 avatar commented on August 16, 2024

@MacKentoch Oh! Oops! Sorry for my wrong understanding. There is no issue then.

from react-native-beacons-manager.

sankar9659 avatar sankar9659 commented on August 16, 2024

I faced this error while running in simulator. In real device, the screen shows as blank white screen.

from react-native-beacons-manager.

RashVenkat6795 avatar RashVenkat6795 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.