Comments (11)
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.
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!!!
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
from react-native-beacons-manager.
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.
Hello, has anyone managed to resolve this or receiving a similar behaviour?
from react-native-beacons-manager.
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.
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.
@ashemah awesome! 👏
Your PR is welcomed, you did not did that for nothing.
It will greatly improve the librairie.
from react-native-beacons-manager.
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.
@ashemah can we use didDetermineState to trigger an entry event if you are already in a region?
from react-native-beacons-manager.
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.
@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)
- 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.