Hello!
I’m currently using background geolocation and it is working correctly, now I have to implement a vibration and a sound based on the position of the user.
But using simply the background geolocation service I’m not able to use those plugins.
Meaning, sound and vibration works while in foreground, background location works correctly, but I can’t make the phone vibrate and sound while in background.
Code:
let config: BackgroundGeolocationConfig = {
desiredAccuracy: 0,
stationaryRadius: 1,
distanceFilter: 1,
debug: true,
interval: 200,
fastestInterval: 120000,
activitiesInterval: 200,
};
this.backgroundGeolocation.configure(config).subscribe((location: BackgroundGeolocationResponse) => {
this.vibration.vibrate(100);
this.nativeAudio.play('uniqueId1', () => console.log('uniqueId1 is done playing'));
this.lat = location.latitude;
this.lng = location.longitude;
}, (err) => {
console.log(err);
});
Any hep?