Git Product home page Git Product logo

Comments (5)

gpibarra avatar gpibarra commented on June 19, 2024 1

Service background run in an independent process, the static variables of the main process are not accessible from the background process (there are other instances of those same variables).
Try shared preferences. As for the exception, check the documentation: https://github.com/rekab-app/background_locator/wiki/Use-other-plugins-in-callback

from background_locator.

praveenbbhati avatar praveenbbhati commented on June 19, 2024

Hi @miamir2000 Can you please explain what you want to achieve?

from background_locator.

miamir2000 avatar miamir2000 commented on June 19, 2024

Hi praveenbbhati,

I would like to push username, latitude & longitude to cloud server inside callback function.

  1. Try using global variable (static String username) - when I set value, it not reflect value inside callback function.
  2. Try store value using shared preference & retrieve inside callback function, got exception error.

Please advise, thank you in advance.

static void callback(LocationDto locationDto) async {
// TODO:
sendLocation(username, locationDto.latitude, locationDto.longitude);
}

from background_locator.

mehdok avatar mehdok commented on June 19, 2024

@miamir2000 Do you still have problem or found a workaround?

from background_locator.

mehdok avatar mehdok commented on June 19, 2024

Closing this issue due inactivity.

from background_locator.

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.