darron1217 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
33 stars 36 forks source link

Question: do I need ACCESS_BACKGROUND_LOCATION for Android >= 10? #8

Closed walterdl closed 3 years ago

walterdl commented 3 years ago

Your Environment

Context

This is just a question. I'm wanting help.

¿Do I need to set the ACCESS_BACKGROUND_LOCATION in my AndroidManifest.xml to get background location in Android >= 10? If so, ¿Could I request such permission myself instead of the library do it automatically?

Thanks for the library!

Expected Behavior

N/A

Actual Behavior

N/A

Possible Fix

Steps to Reproduce

N/A

Context

N/A

Debug logs

N/A

darron1217 commented 3 years ago

We don't need ACCESS_BACKGROUND_LOCATION permission for this plugin. It was my mistake to add it on version 0.6.4~0.6.5. And this plugin automatically requests permission.

The reason is described here. (This plugin actually uses foreground service on Android to do background tasks) https://github.com/darron1217/react-native-background-geolocation#android-background-service-issues

walterdl commented 3 years ago

And this plugin automatically requests permission.

Could I request the permissions by myself in some way? Because I would like to request permission just when the user will use the feature related to location tracking.

walterdl commented 3 years ago

~Could I request the permissions by myself in some way? Because I would like to request permission just when the user will use the feature related to location tracking.~

Nevermind, I saw that by invoking the start method the lib requests permission, so I will call it in my "start location tracking" button.

Thanks!

darron1217 commented 3 years ago

Great :) I'm closing this issue

walterdl commented 3 years ago

@darron1217 maybe you know if I need to accomplish the Permissions Declaration Form guidance in order to publish an app that uses this library?

I'm not sure that despite getting the user location in a foreground service I need follow such rules.

darron1217 commented 3 years ago

@walterdl If you have installed latest version 0.6.6, then you don't need to write the form.

But I found that google checks every latest releases of every channels (beta, alpha... etc) to check whether this app uses background behavior or not. So make sure that your binary is updated on every channel.

walterdl commented 3 years ago

Thanks a lot for your answer.

By "make sure that your binary is updated on every channel" you mean to be sure that I have the 0.6.6 installed in each apks uploaded in each channel that uses the library? but ignoring apks that don't have the library installed, like previous releases in my store. Right?

walterdl commented 3 years ago

Also please notice that my targetSdkVersion is 29

darron1217 commented 3 years ago

@walterdl Right. You don't need to update it if your binary is not using background permission.