Please provide the following:
- SDK Version: 48
- Platforms: Android
I have an app that is supposed to record the location even when the app is running in the background. However, after a certain time, the location is always sent at longer intervals.
To prevent this, the foreground service should be activated. However, this does not show any notification.
if (this.backgroundStatus == 'granted') {
await Location.startLocationUpdatesAsync(taskName, {
accuracy: Location.Accuracy.BestForNavigation,
timeInterval: backgroundTaskTimeIntervall.executeTask,
activityType: Location.ActivityType.AutomotiveNavigation, //AutomotiveNavigation,
showsBackgroundLocationIndicator: true,
foregroundService: {
notificationTitle: "App is running",
notificationBody: "Location tracking",
},
});
}
For this purpose, I have entered FOREGROUND_SERVICE in the authorisations