Comments (9)
@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();
ranging should work now, let us know :)
from react-native-beacons-manager.
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.
@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.
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.
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.
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.
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.
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.
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)
- 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
- data.beacons returning empty array, facing issue in Android only, getting Distance & Proximity in iOS.
- data.beacons returning empty array, facing issue in Android only, getting Distance & Proximity in iOS. HOT 1
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.