2

Finally got a phonegap app to share location when the app is in the background. The plugin documentation no where says that you cant test it on the phonegap app and that you have actually install it in your phone to test the background location sharing.

Comments
  • 0
    provide info how you did it
  • 1
    I've implemented a similar app a year ago and I've used this plugin https://github.com/mauron85/..., which worked flawlessly.
  • 0
    Ive used the same plugin which @schlomm used. How I did it was to add the plugin to my app using cordova plugin add statement. You cannot test it on the phonegap app so you might think its not working. But the catch is that it only works when you build your app and install it on a device. So I get my build done with Adobe PhoneGap Build. I upload the app files and APB (Adobe PhoneGap Build) spits out the apk file for android and ipa file for ios if you have your ios certfificates setup with APB. Using those files you can install it on any device (android) but for ios you can install on the device you specified when creating your ios certificate. Once you install the app, use phonegap's device state events to start or stop background location tracking (which again isn't mentioned in the plugin docs). To start background location tracking you use phonegap's device "pause" and device "resume" events to start or stop bg tracking respectively. Hope this helps someone :)
Add Comment