Error: No provider for BackgroundGeolocation!

#1

Runtime Error
No provider for BackgroundGeolocation!
Stack
Error: No provider for BackgroundGeolocation!
at injectionError (http://localhost:8100/build/main.js:1509:86)
at noProviderError (http://localhost:8100/build/main.js:1547:12)
at ReflectiveInjector_.throwOrNull (http://localhost:8100/build/main.js:3048:19)
at ReflectiveInjector
.getByKeyDefault (http://localhost:8100/build/main.js:3087:25)
at ReflectiveInjector
.getByKey (http://localhost:8100/build/main.js:3019:25)
at ReflectiveInjector
.get (http://localhost:8100/build/main.js:2888:21)
at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:3856:52)
at resolveDep (http://localhost:8100/build/main.js:11317:45)
at createClass (http://localhost:8100/build/main.js:11181:32)
at createDirectiveInstance (http://localhost:8100/build/main.js:11001:37)

Getting this error in Ionic 2. I want to get background geolocation and send it my server api. Any ideas how to solve error and do the thing what I want

#2

You’ll need to add BackgroundGeolocation to your providers list found in app.module.ts.

1 Like