I need Implement a Background Geolocation in my app. I acess this ionic documentation, there shows the code below:
this.backgroundGeolocation.configure(config)
.subscribe((location: BackgroundGeolocationResponse) => {
console.log(location);
// IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
// and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
// IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
this.backgroundGeolocation.finish(); // FOR IOS ONLY
});
When I used this code in my app, my ts-lint accuse the configure(config) method is a Promise<any> and not a Observable, so, I cant use subscribe. I switched subscribe for then. But when I run, shows this error below:
ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
at BackgroundGeolocation.configure (vendor.js:82333)
// error below ommited
Thanks so much! Your repository saved my life!! In the Ionic v3 documentation background geolocation says that i need install the last version of the plugin and the version 4 of the background geolocation npm.
When I installed the same error occurred, looking your repository I saw that the versions of the plugin is 2.2.5 and the background geolocation npm is 3.12.1.
So, I installed this version of the plugin and version 3.14.0 of the background geolocation, its works fine now =) Thanks again!
Following the ionic v3 docs, I receive the same error. Looking the @Jalvarez05 repository I saw that the versions was different, when I installed the version plugin 2.2.5 and the version background geolocation npm 3.14.0 worked fine. Thanks by reply my post =)
Thanks for your effort, but i notice in your package.json you are not using @ionic-native/background-geolocation@4
you are using “@ionic-native/background-geolocation”: “^3.12.1”
is there any chance it will work with ionic-native/background-geolocation@4 ?
For a while, i think so its not possible. That worries me, cause i received a Google email saying that their only accept apps with 64 bits from 1 August, and i dont know if the @ionic-native/background-geolocation”: “^3.12.1 is in 64 bits.
I’ve tried with ionic-native/background-geolocation@4 , but it never worked , for this reason i’ve used another version … Here is another complete example , check it :
Really I don’t know, but from Ionic 4 is release, i’ve gotten errors using ionic 3.9.2 with the new way to import plugins : adding /ngx on the end like official documentation.
Is it crashing on Android 9. Has someone ever solved this problem? And I can’t using the version “cordova-plugin-mauron85-background-geolocation”: "^3.0.0-alpha.50 on ionic 3.