Giter Club home page Giter Club logo

Comments (6)

nckraghu avatar nckraghu commented on September 26, 2024 4

Hmm... thanks. I am thinking of implementing it natively, but I am completely new to RN. If I can find a solution, I will share the implementation.

from react-native-background-geolocation.

nckraghu avatar nckraghu commented on September 26, 2024

@pewh Did you find a way to find current location?

from react-native-background-geolocation.

pewh avatar pewh commented on September 26, 2024

Unfortunately, no :/
Current solution in official RN is still buggy, and I still don't have any solution with this repo

from react-native-background-geolocation.

serusko avatar serusko commented on September 26, 2024

so just start and on location event stop service :) but in general is this good idea? bcs you need some time to get better accuracy

from react-native-background-geolocation.

lon-io avatar lon-io commented on September 26, 2024

Solution taken from the example app:

  toggleTracking() {
    if (this.state.isTracking) {
      this.stopTracking();
    } else {
      this.startTracking();
    }
  }
  
  startTracking() {
    if (this.state.isTracking) { return; }

    BackgroundGeolocation.start(() => {
      console.log('[DEBUG] BackgroundGeolocation started successfully');
    });
    this.setState({ isTracking: true });
  }

  stopTracking() {
    if (!this.state.isTracking) { return; }

    BackgroundGeolocation.stop();
    this.setState({ isTracking: false });
  }
  const Button = this.state.isTracking ? <Text>Stop</Text> : <Text>Start</Text>; 

  <TouchableOpacity onPress={this.toggleTracking.bind(this)}>
            {Button}            
  </TouchableOpacity>

from react-native-background-geolocation.

mauron85 avatar mauron85 commented on September 26, 2024

Notice: this issue has been closed because it has been inactive for 73 days. You may reopen this issue if it has been closed in error.

from react-native-background-geolocation.

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.