Ionic 4 - Cannot read property 'onLocation' of undefined TypeError: Cannot read property 'onLocation' of undefined
Closed this issue · 1 comments
After converting the simple map example to Ionic 4, the import function fails, with an error
import BackgroundGeolocation, {
Location,
HttpEvent,
HeartbeatEvent,
MotionActivityEvent,
ProviderChangeEvent,
MotionChangeEvent,
ConnectivityChangeEvent
} from "cordova-background-geolocation-lt";
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'onLocation' of undefined
TypeError: Cannot read property 'onLocation' of undefined
at Function.push../node_modules/cordova-background-geolocation-lt/src/ionic/index.js.BackgroundGeolocation.onLocation (index.js:181)
(See attached filed)
What is the proper way to import this plugin in Ionic 4?
This is not the Cordova plugin repo. This is the SampleApp repo.
https://github.com/transistorsoft/cordova-background-geolocation-lt