GithubHelp home page GithubHelp logo

Comments (9)

relaxedtomato avatar relaxedtomato commented on July 29, 2024 2

@wcastand, noticed one issue:

Beacons.requestAlwaysAuthorization();
Beacons.startRangingBeaconsInRegion(region);
Beacons.startMonitoringForRegion(region);
Beacons.startUpdatingLocation();

should be

Beacons.requestAlwaysAuthorization();
Beacons.startMonitoringForRegion(region);
Beacons.startRangingBeaconsInRegion(region);
Beacons.startUpdatingLocation();

as per https://github.com/MacKentoch/react-native-beacons-manager/blob/master/examples/samples/monitoringAndRanging.ios.md

ranging should work now, let us know :)

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024 1

Hi @wcastand

Nothing more to add since all is already nicely covered

As you said and I agree with you, the best bet with iOS when in background is to rely on localNotifications (or notifications in general).

Local Notifications have more power in iOS so you are sure iOS won't prevent your app to get notified (by execution time limitation or just because system consider it has more important to do at the moment).

I think I should also add an example of use case with background + localNotification.
It will help in case there some fix are needed or at least it will help using the library.

from react-native-beacons-manager.

relaxedtomato avatar relaxedtomato commented on July 29, 2024

@wcastand - logging may not work (I had some issues logging when in background before), and background mode only works for regions enter/exit events. Ranging beacons is not supported in the background. Do share the link to the example you followed (or your code snippet) and I can take a look and get back to you.

Ranging works, however, you may have some scenarios where you do not range beacons (when they exist) due to timing issues (when the device scans and when the beacon broadcasts). This can be mitigated very easily (collecting a few events to confirm a beacon was ranged).

from react-native-beacons-manager.

wcastand avatar wcastand commented on July 29, 2024

This the example i used as a base: link with this piece for the monitoring part link

Ok, i'll try to make my notifications in local work and then try without logging then.

So if i understand correctly, there is no way to know which beacon enter or exit the region when we are in background mode (like Android) ?

from react-native-beacons-manager.

relaxedtomato avatar relaxedtomato commented on July 29, 2024

Have not had a chance to look at the code snippet, for your last question - does this response help? #16

from react-native-beacons-manager.

wcastand avatar wcastand commented on July 29, 2024

Hi,

Sorry for the response time, i was testing and trying to make things work...
So after 2 days of testing, i can't get the monitoring to work.

It never detect a beacon (in foreground and background mode).
And i don't know if it's a bug but when i use the ranging, he detects the beacons at first but if i close the app and reopen it, the listener is still logging but doesn't detect the beacons anymore.

So i was thinking that may be related to the problem with monitoring. If after closing the app, the beaconsDidRange doesn't detect beacons anymore. Maybe the monitoring act the same and doesn't fire the event for some reason.

Device: Iphone 5S
OS: IOS 10.3
React native : 0.43.3
React: 16.0.0-alpha.6
beacons-manager : 1.0.4

This is the project i use for testing : link

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024

Hi @wcastand

I've looked into your project code (did not test), as @r-bansal suggested you must correct here.

You must start monitoring always before ranging.

Otherwise to be sure to cover all, what kind of beacon do you use?
I mean:

  • physical one
  • software emulated

AND:

  • ibeacon
  • eddystone
  • any other kind?

If you have an alternate an android phone you could use this application since it is a complete simulator (my preferred to be honest) and well designed.

Otherwise even iOS one (less complete) is ok.

Another question, it seems interesting that you have React v16.0.0-alpha.6. Did you manually installed this version?

from react-native-beacons-manager.

wcastand avatar wcastand commented on July 29, 2024

Hi,
I was on this all day, i came up with something that work. I switch ranging and monitoring.
I use physical ibeacon from Estimote.

I'm in React Alpha on the test because i have the last version of react-native-cli and they use react alpha for Fiber i think with React native 0.43. So, it's done automatically by the cli.

I still have some issues with the detection. The ranging seems to failed if i quit and then reopen the app. The Ranging is still firing event but doesn't detect my beacons anymore. At some point i have to deactivate my bluetooth and reactivate it in order to detect my beacons again.

Leaving the app and switching with monitoring and ranging seems to broke the detection somehow.

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024

Thanks that was really interesting.

I will upgrade the example and test.
It may come from native since like that I don't see what could be added to native code for this purpose.

Concerning ReactJS version I did not create a new app from cli since 0.43.
Thanks to you 👏 I upgrade some applications and at least I win FlatList from core React Native.

You may be right (use of alpha for Fiber) it is just surprising since last December I remember I heard FB saying that Fiber may not come for sure in React 16 but maybe 17 since there were so much work to be done first.

That would be really awesome it comes with React 16 and React Native needs even more the benefit of Fiber.

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.