transistorsoft / cordova-background-geolocation-firebase

Firebase Adapter for Cordova Background Geolocation
MIT License
7 stars 5 forks source link

Logs show plugin initialized, but nothing written to firestore #4

Closed invention7 closed 5 years ago

invention7 commented 5 years ago

Have the plugin installed in my Ionic project per instructions.
adb logcat begins with:

09-19 12:20:20.954 24388 24968 I TSLocationManager: [c.t.c.b.CDVBackgroundGeolocationFirebase execute] 09-19 12:20:20.954 24388 24968 I TSLocationManager: ℹ️ [Firebase] $ configure 09-19 12:20:21.287 24388 24968 I TSLocationManager: [c.t.c.b.CDVBackgroundGeolocationFirebase configure] 09-19 12:20:21.287 24388 24968 I TSLocationManager: ℹ️ [Firebase] - configure: {"locationsCollection":"locations","geofencesCollection":"geofences"} 09-19 12:20:21.420 24388 24968 I TSLocationManager: [c.t.l.adapter.TSConfig print]

Following this, logcat shows location and geofence events, but I'm not seeing anything written to firestore.

Attaching a logcat dump.

Here's the init of the plugin:

`this.bgGeo = (<any>window).BackgroundGeolocation;
const bgGeoFirebase = (<any>window).BackgroundGeolocationFirebase;

bgGeoFirebase.configure({
  locationsCollection: 'locations',
  geofencesCollection: 'geofences'
});`

and the config of background-geolocation:

private initBackgroundGeolocation(){ // 3. Configure it. this.bgGeo.ready({ debug: false, desiredAccuracy: this.bgGeo.DESIRED_ACCURACY_HIGH, distanceFilter: 5, // Activity Recognition config activityRecognitionInterval: 7500, stopTimeout: 5, // Application config //foregroundService: true, stopOnTerminate: true, startOnBoot: false, stopDetectionDelay: 5, logLevel: this.bgGeo.LOG_LEVEL_VERBOSE, // url: 'http://192.168.11.100:8080/locations', // autoSync: true }, (state) => { // 3. Start tracking console.debug('BackgroundGeolocation is configured and ready to use'); if (!state.enabled) { this.bgGeo.start(function() { console.debug('- BackgroundGeolocation tracking started'); }); } }); }

and google-service.json is sitting in platforms/android/app/

Any thoughts are appreciated.

log.txt

invention7 commented 5 years ago

Got it!

I was running background-geolocation 2.12, where 2.13.+ is required for this plugin.

All good now : )

christocracy commented 5 years ago

ah, right. The docs are still a bit raw for the Cordova version.

markokhman commented 5 years ago

I have latest versions installed, geolocation is getting logged in console, but nothing is written to the database