GithubHelp home page GithubHelp logo

Comments (11)

MacKentoch avatar MacKentoch commented on July 29, 2024 3

Working on it.

Strange issue at first sight.

I dream I left my old iPhone 5c with iOS 9 since I suspect something related to iOS 10.x...
Anyway I will fix it.

Thank you for your patience.

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024 2

It works (iOS example).

BUT regionDidEnter and regionDidLeave trigger ONLY after few seconds - like 30 seconds (= eternity for electronics) - (I guess Apple wants to save battery consumption...)

If your application starts and beacons is already in range: regionDidEnter won't trigger!!!

beacon-did-enter

I just added this line in my code (it is not mandatory) to force drop empty range:

Beacons.shouldDropEmptyRanges(true);

Ensure your Plist contains both keys with messages (don't leave messages blank, it seems like Apple force now to write a message to make it work):

  • Privacy - Location When In Use Usage Description
  • Privacy - Location Always Usage Description
  • I even added (but it is not sufficient itself alone so I guess it is no use): Privacy - Location Always and When In Use Usage Description

beacon-monitor

from react-native-beacons-manager.

ashemah avatar ashemah commented on July 29, 2024 1

Hi MacKentoch. I have a working version of this now as well after forking and modifying your code. Haha - I should have waited :)

So what I did was upgrade the iOS code to use RCTEventEmitter instead of sending through the bridge. This is inline with the latest code iOS examples in the RN docs: https://facebook.github.io/react-native/docs/native-modules-ios.html

It's now sending stuff to JS very responsively. There is a bit of a delay when moving in and out of regions but that's normal (of up to 30s when off cabled power. I am seeing only 10s on power).

I am also adding a listener for:

  • (void) locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region;

This will be called when you start monitoring and let you know if you are ALREADY in a region.

I'll get a pull request together for it in a bit.

from react-native-beacons-manager.

Shauneoo avatar Shauneoo commented on July 29, 2024

Hello, has anyone managed to resolve this or receiving a similar behaviour?

from react-native-beacons-manager.

ashemah avatar ashemah commented on July 29, 2024

I am also affected by this issue and hoping for a quick fix.

Is it due to RCTDeviceEventEmitter now being deprecated/fatal?

https://github.com/facebook/react-native/releases/tag/v0.48.0

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024

Thank you @ashemah for helping.

I don't think it is related to RCTDeviceEventEmitter since monitoring and ranging use it both but they aren't both affected by this issue.

I suspected Plist new constraint but it does not seem to be the case.

Right now I honestly don't understand why this occurs.
Still looking for the origin of the issue then it will be fixed.

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024

@ashemah awesome! 👏

Your PR is welcomed, you did not did that for nothing.

It will greatly improve the librairie.

from react-native-beacons-manager.

MacKentoch avatar MacKentoch commented on July 29, 2024

I close this issue.

PR #46 should improve even more iOS (already on master: beware breaking to attach event listeners: more details before v1.0.8 release)

from react-native-beacons-manager.

eurobob avatar eurobob commented on July 29, 2024

@ashemah can we use didDetermineState to trigger an entry event if you are already in a region?

from react-native-beacons-manager.

ashemah avatar ashemah commented on July 29, 2024

Hi @eurobob yep that is right. It will be called when the app starts and will either indicate inside or outside or unknown.

from react-native-beacons-manager.

innyso avatar innyso commented on July 29, 2024

@MacKentoch Hi, thanks for the ios example. I am tried it on my ios device. It works for ranging but not for monitoring. I understand that regionDidEnter will only get trigger when the device is not in the region when the app bootup. How about regionDidExit? I didnt seems to be able to get it trigger.

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.