Comments (11)
@rfranczyk working on it this week. I'll follow up with some results shortly.
from react-native-boundary.
Hi Eddie, Wondering if by chance you were able to fix this issue by using JobIntentService? It would be a lifesaver.
from react-native-boundary.
Ok, I'm going to try another way (since it didn't seem to work with the above technique) with LocalBroadcastManager
s - will let you know how it goes.
from react-native-boundary.
I've tested on Android 7.0, 8.1 and 9.0 and found that events are emitted on 7.0 but not on Android 8.1 and 9.0. It appears that the problem is most likely with the Intent Service and doze mode in 8.0 as suggested in the stackoverflow link. You might want to give Job Intent Service a try.
from react-native-boundary.
Here is some tips on geo fencing using Job Intent Service and BroadcastReceiver for geo fencing:
Maybe this might help.
from react-native-boundary.
@cloudmobiledevelopment thanks a lot for your research! I remember playing around with JobIntentService but I couldn't get consistent results. I'll revisit this though and follow up with what I've found.
from react-native-boundary.
+1
from react-native-boundary.
So I've been playing around with the JobIntentService
quite a bit and I can get it to work very nicely on the Android side. Geofences are triggered, and sent to the appropriate places but I can't get past the hurdle of the ReactApplicationContext
being bound to the RNBoundaryModule
class.
As you can see here in my branch, the context passed to BoundaryEventJobIntentService
is not the ReactApplicationContext
which I need to publish events. I'm a bit stumped as to how I can leverage this service and still have access to the context.
I'm definitely no Android expert so if anyone can chime in with some help I'd be very grateful!
from react-native-boundary.
Might you need the JobIntentService#getApplicationContext()
@eddieowens ? I'm new to RN but proficient with Android. The BaseContext
in this instance would refer to the underlying android.app.Service
which isn't a ReactContext
. So calling getApplicationContext()
would invoke the ContextWrapper
that should go off and find the application context... which I think is what we need?
from react-native-boundary.
@BrantApps ya I've tried all of the contexts available but none of them can be cast to the ReactApplicationContext
which doesn't make much sense to me. Thanks for looking into this too!
from react-native-boundary.
This has been fixed thanks to the work and help of @BrantApps. The Boundary
will still not trigger in the background if the app has been dozed. Creating another issue to address that problem but this fix is in as of 1.0.7
from react-native-boundary.
Related Issues (20)
- How to check boundary for a line/route between two points? HOT 1
- Pod Fail - HOT 5
- Boundary "on Enter" not firing on iOS 13
- New Event - Currently in the added geofence or not
- events not firing in android 10 in react-native 0.61.5 HOT 6
- Headless event listener not called when app is killed HOT 24
- [Android] Re-register boundaries on device boot
- Problem in testing the app HOT 1
- Boundary dont start when i allow only use in app HOT 4
- Is there any way that we can get events for Gps Turned off/on?
- Updated podspec file
- Headlessjs doesn't take effect when app is killed and when is background
- Issue PendingIntent.FLAG_IMMUTABLE app crashed on Android app Target 31 (Android 12) HOT 1
- Got error code 1004
- React Native Boundary Enter and Exit Trigger
- App Error JobIntentService HOT 2
- Pemission issue HOT 1
- need to reboot device for geofence in/out events
- how to integrate in kotlin
- new NativeEventEmitter()` requires a non-null argument.
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-boundary.