christocracy / cordova-plugin-background-geolocation

Sophisticated, battery-conscious, cross-platform background-geolocation with motion-detection
http://transistorsoft.github.io/cordova-background-geolocation
492 stars 743 forks source link

Android app crash after ready alert #270

Closed boazlautman closed 5 years ago

boazlautman commented 5 years ago

I compile the app with builds.phonegap.com App crashes after showing the "BackgroundGeolocation tracking started" alert.

// 1. Listen to events var bgGeo = window.BackgroundGeolocation;

            // 2. Execute #ready method:
            bgGeo.ready({
                reset: true,  // <-- true to always apply the supplied config
                distanceFilter: 10
            }, function (state) {    // <-- Current state provided to #configure callback
                // 3.  Start tracking
                alert('BackgroundGeolocation is configured and ready to use');
                if (!state.enabled) {
                    bgGeo.start().then(function () {
                        alert('- BackgroundGeolocation tracking started');
                    });
                }
            });
christocracy commented 5 years ago

Of course it does. Have you read the README of this deprecated repo you’re apparently using?

No, you didn’t.