I have created an app using the Tabs starter project with Vue and Capacitor and followed the tutorial ‘Your first Ionic App’ to add a Photo Gallery on the 2nd Tab.
I’m now trying to add a Cordova plugin called ‘cordova-background-geolocation’ to the 3rd Tab but am having trouble understanding how to use it in Vue (I’m using a Vue 2 approach).
I cloned the sample repo https://github.com/transistorsoft/cordova-background-geolocation-SampleApp but this uses angular which I’m not familiar with enough to translate it over to Vue.
If I try and reference it in a method() function I get undefined
but doing console.log("Mounted", Object.keys(BackgroundGeolocation));
in mounted() will dump out the keys so it is loading when using
import BackgroundGeolocation, {
Location,
MotionChangeEvent,
MotionActivityEvent,
GeofenceEvent,
Geofence,
HttpEvent,
ConnectivityChangeEvent
} from "cordova-background-geolocation-lt";
Should I be adding the BackgroundGeolocation to the Vue’s data object before using it?