Code Monkey home page Code Monkey logo

Comments (10)

christocracy avatar christocracy commented on August 23, 2024 1

Forget about react-native-geolocation, it's no good. Tracking a device in the background is complex. If you want to track a device in the background, use my react-native-background-geolocation it's the best you'l'l find. I've been working on this for almost 4 years.

My react-native-background-geolocation WILL continue tracking, even if user terminates the app.

from react-native-background-fetch.

christocracy avatar christocracy commented on August 23, 2024

If user terminates the app, fetch ceases.

If os terminates app (eg: due to memory pressure, fetch will not cease.

from react-native-background-fetch.

julesmoretti avatar julesmoretti commented on August 23, 2024

@christocracy Is there a way to have background fetching after app gets closed by user using other methods?

And did I miss these subtleties in your doc?

Thank you.

from react-native-background-fetch.

christocracy avatar christocracy commented on August 23, 2024

When user terminates the app, background fetch is ceased, period.

There is no hope for a background fetch to occur after user explicitly terminates the app.

from react-native-background-fetch.

julesmoretti avatar julesmoretti commented on August 23, 2024

Hey @christocracy, one last question for you.

Does having a background location fetch super seed your module? I ask this because I have both going on and I can see the geolocation refresh in the background but not your module. I left it running all night.

Thank you.

from react-native-background-fetch.

christocracy avatar christocracy commented on August 23, 2024

This is not background "location fetch". This module has nothing to do with location. It's merely an iOS mechanism that awakens an app in background, providing 30s of bg time.

No this module does not supercede background Geolocation, in fact it was designed as a dependency for it.

If simulate background fetch works in Xcode, that's all you need to know. Apple's fetch algorithm is a black box based upon usage behaviour. It's pointless to "wait" for fetch to occur. Just use the app like a user would and the algorithm will "learn" your behaviour and fetches will come.

from react-native-background-fetch.

christocracy avatar christocracy commented on August 23, 2024

Are you using my react-native-background-geolocation module for location?

https://github.com/transistorsoft/react-native-background-geolocation

from react-native-background-fetch.

julesmoretti avatar julesmoretti commented on August 23, 2024

Hello @christocracy thank you for your swift response and my apologies for the confusion from my end.

My initial goal was to have an app that keeps sending my geolocation to a firebase database.

I assumed that this could occur in the background even though the app was completely closed by user (which now I understand is not possible).

So now I am still trying to do the same thing but while having my app open but in the background and or while my screen is locked.

What I did to achieve this is to follow facebook react-native Geolocation which states "In order to enable geolocation in the background, you need to include the 'NSLocationAlwaysUsageDescription' key in Info.plist and add location as a background mode in the 'Capabilities' tab in Xcode." which I have.

Before getting some clarity from you about the inability to have background task run if the app is completely closed, I went ahead and tried to implement also your repo.

With both installed and having the app still open but in the background, I am only seeing the Geolocation fire very frequently (every 15 seconds or so) which gets reflected on firebase successfully, but I do not see any activity from yours.

So this is why I was wondering if the react-native Geolocation implementation super seeds your repo?

from react-native-background-fetch.

julesmoretti avatar julesmoretti commented on August 23, 2024

Thank you for the link, but $349... is a bit steep for a personal/non commercial app.

from react-native-background-fetch.

christocracy avatar christocracy commented on August 23, 2024

from react-native-background-fetch.

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.