GithubHelp home page GithubHelp logo

Comments (11)

eddieowens avatar eddieowens commented on August 23, 2024 4

@rfranczyk working on it this week. I'll follow up with some results shortly.

from react-native-boundary.

rfranczyk avatar rfranczyk commented on August 23, 2024 1

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.

BrantApps avatar BrantApps commented on August 23, 2024 1

Ok, I'm going to try another way (since it didn't seem to work with the above technique) with LocalBroadcastManagers - will let you know how it goes.

from react-native-boundary.

cloudmobiledevelopment avatar cloudmobiledevelopment commented on August 23, 2024

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.

cloudmobiledevelopment avatar cloudmobiledevelopment commented on August 23, 2024

Here is some tips on geo fencing using Job Intent Service and BroadcastReceiver for geo fencing:

https://stackoverflow.com/questions/46675242/issue-moving-from-intentservice-to-jobintentservice-for-android-o

Maybe this might help.

from react-native-boundary.

eddieowens avatar eddieowens commented on August 23, 2024

@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.

gtdrag avatar gtdrag commented on August 23, 2024

+1

from react-native-boundary.

eddieowens avatar eddieowens commented on August 23, 2024

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.

BrantApps avatar BrantApps commented on August 23, 2024

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.

eddieowens avatar eddieowens commented on August 23, 2024

@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.

eddieowens avatar eddieowens commented on August 23, 2024

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)

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.