locked
Background location updates in Xamarin.Forms. How to? RRS feed

  • Question

  • User37316 posted

    Anyone has a tutorial or some documentation to get started on this topic?

    I've read and downloaded the BackgroundLocationDemo that has both ios and android projects mentioned in the Xamarin documentation (which are not working out of the box btw).

    However I can't seem to grasp how to connect that to a xamarin.forms app.

    Any advice or push in the right direction?

    Thank you

    Friday, August 14, 2015 11:43 PM

Answers

  • User66293 posted

    Woops, no I don't think it will retrieve the location when backgrounded. However, the code is well structured. So if you extend it create for example an android service (like in the BackgroundLocationDemo), I'm quite sure you will get it to work.

    I you can't find, I can try to extend some other time.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, August 15, 2015 1:23 PM

All replies

  • User66293 posted

    Hi @AlejandroForonda,

    You can take look to the GeoLocator plugin written by JamesMontemagno. You can find it on: https://github.com/xamarin/plugins

    If you want to write it yourself, I would take a look at the DependencyService from Xamarin: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/dependency-service/

    Hope it is of any help!

    Saturday, August 15, 2015 9:48 AM
  • User37316 posted

    Ok. I've seen that plugin before but I didn't know this was able to listen to location in the background.

    So this plugin is able to listen to location updates while the app is in the background?

    Saturday, August 15, 2015 11:58 AM
  • User66293 posted

    Woops, no I don't think it will retrieve the location when backgrounded. However, the code is well structured. So if you extend it create for example an android service (like in the BackgroundLocationDemo), I'm quite sure you will get it to work.

    I you can't find, I can try to extend some other time.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, August 15, 2015 1:23 PM
  • User37316 posted

    ok you are right I should use the plugin to get started. Thanks for yout time

    Saturday, August 15, 2015 1:49 PM