Ionic Background Geolocation + Local Notifications

I have successfully installed and tested the background geolocation module at the URL below. Now I am trying to combine it with local notification. Basically trigger a notification upon the location update. Any suggestions?

how can i use the plugin with the ionic? mind share the code?

call $cordovaBackgroundGeolocation in your controller after installing the plugin and follow the code provided by the plugin owner.

If you know javascript and Anngular.js then it should be a breeze for you. If not then you should get some professional help. Good Luck.

so you mean

backgroundGeolocation.configure(callbackFn, failureFn, {
    desiredAccuracy: 10,
    stationaryRadius: 20,
    distanceFilter: 30,
    url: 'http://192.168.81.15:3000/locations',
    httpHeaders: { 'X-FOO': 'bar' },
    maxLocations: 1000,
    // Android only section
    locationProvider: backgroundGeolocation.provider.ANDROID_ACTIVITY_PROVIDER,
    interval: 60000,
    fastestInterval: 5000,
    activitiesInterval: 10000,
    notificationTitle: 'Background tracking',
    notificationText: 'enabled',
    notificationIconColor: '#FEDD1E',
    notificationIconLarge: 'mappointer_large',
    notificationIconSmall: 'mappointer_small'
});

into

$cordovaBackgroundGeolocation.configure(callbackFn, failureFn, {
    desiredAccuracy: 10,
    stationaryRadius: 20,
    distanceFilter: 30,
    url: 'http://192.168.81.15:3000/locations',
    httpHeaders: { 'X-FOO': 'bar' },
    maxLocations: 1000,
    // Android only section
    locationProvider: backgroundGeolocation.provider.ANDROID_ACTIVITY_PROVIDER,
    interval: 60000,
    fastestInterval: 5000,
    activitiesInterval: 10000,
    notificationTitle: 'Background tracking',
    notificationText: 'enabled',
    notificationIconColor: '#FEDD1E',
    notificationIconLarge: 'mappointer_large',
    notificationIconSmall: 'mappointer_small'
});

No more like this http://ngcordova.com/docs/plugins/backgroundGeolocation/

Its the same plugin except the one on ngCordova has a paid version and the other is a fork of it. Cheers!

last question. the option/config you follow the https://github.com/mauron85/cordova-plugin-background-geolocation#real-world-example right? sorry im kinda stuck at this. i really appreciate if you can help. thank you in advance

this is my output. mind help?

[INFO:CONSOLE(454)] "Uncaught TypeError: Cannot call method 'start' of undefined", source: file:///android_asset/www/js/ngcordova/dist/ng-cordova.js (454)

Please post your code here and I can look into it.

thanks bro but right now im using this repo https://github.com/pmwisdom/cordova-background-geolocation-services. it’s free :smiley:

great. did it work for yoU? I had looked at it but felt more comfortable with the other one. Many solutions for the same problem. Good Luck :slight_smile:

its working for both android and ios. thanks mate. goodluck to you too