Closed Daavidaviid closed 4 years ago
@mauron85 Do you know anything related to this issue ? I just read about the new changes about foreground services on recent version of android : https://developer.android.com/preview/privacy/foreground-service-types
Looks like a service might need to be defined with a new property in the AndroidManifest.xml
:
<service ...
android:foregroundServiceType="location" />
What do you think ?
Did you request this permission?
android.permission.ACCESS_BACKGROUND_LOCATION
https://developer.android.com/about/versions/10/privacy/changes
Is it fixed?
Requesting the android.permission.ACCESS_BACKGROUND_LOCATION
permission at runtime seems to have fixed it on Android. I'm still having an issue on iOS where the recording stops for a reason I can't understand yet
Did you tried on Chinese custom rom such as Oppo, Vivo ...? i stuck with it for almost 3 weeks already.
Are you using headlessTask as well?
Would you mind of sharing snippet of it?
Did you tried on Chinese custom rom such as Oppo, Vivo ...? i stuck with it for almost 3 weeks already.
Hopefully I didn't have this issue, but it might be link to this : https://dontkillmyapp.com/ what do you think ?
Are you using headlessTask as well?
No only sending the geolocation to the API in the background
Would you mind of sharing snippet of it?
Sure.
BackgroundGeolocation.configure({
desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
fastestInterval: 20 * SECOND,
interval: 20 * SECOND,
activitiesInterval: 5 * SECOND,
distanceFilter: 50,
stationaryRadius: 50,
notificationTitle: i18n.geolocation.title,
notificationText: i18n.geolocation.text,
activityType: 'AutomotiveNavigation',
startForeground: true,
httpHeaders,
pauseLocationUpdates: false,
locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
saveBatteryOnBackground: false,
debug: false,
stopOnTerminate: true,
maxLocations: 100000,
stopOnStillActivity: false,
syncUrl: `${baseUrl}/trips/${tripId}/coordinates`,
url: `${baseUrl}/trips/${tripId}/coordinates`,
postTemplate,
// @ts-ignore
syncThreshold: 10,
});
I think it would be nice if this library was added to https://github.com/react-native-community @react-native-community
I think it would be nice if this library was added to https://github.com/react-native-community @react-native-community
Support!
Did you tried on Chinese custom rom such as Oppo, Vivo ...? i stuck with it for almost 3 weeks already.
Hopefully I didn't have this issue, but it might be link to this : https://dontkillmyapp.com/ what do you think ?
Are you using headlessTask as well?
No only sending the geolocation to the API in the background
Would you mind of sharing snippet of it?
Sure.
BackgroundGeolocation.configure({ desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY, fastestInterval: 20 * SECOND, interval: 20 * SECOND, activitiesInterval: 5 * SECOND, distanceFilter: 50, stationaryRadius: 50, notificationTitle: i18n.geolocation.title, notificationText: i18n.geolocation.text, activityType: 'AutomotiveNavigation', startForeground: true, httpHeaders, pauseLocationUpdates: false, locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER, saveBatteryOnBackground: false, debug: false, stopOnTerminate: true, maxLocations: 100000, stopOnStillActivity: false, syncUrl: `${baseUrl}/trips/${tripId}/coordinates`, url: `${baseUrl}/trips/${tripId}/coordinates`, postTemplate, // @ts-ignore syncThreshold: 10, });
Thank you bro.
I was able to fix my problems on iOS using this library : https://github.com/transistorsoft/react-native-background-geolocation
It's free on iOS and maintained frequently
How did you migrate this to SDK29?
is this package abandoned?
Your Environment
Context
I had to migrate from SDK28 to SDK29 on Android, and it looks like since i migrated, the background geolocation isn't working anymore.
Expected Behavior
It should work ok
Actual Behavior
It seems to only be working when the app is in the foreground
Possible Fix
It looks like the foreground service isn't working, I don't know why.
Steps to Reproduce
Context
Debug logs