-
-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to access location only in foreground #535
Comments
Hey Fulvio, could you fiind any solution? I'm also with the same issue. |
İ am also with the same issue. Actually my app does not use location in background. But google play says to me : You are use in location in background. I think that because of this plugin, the application has permission to access background location. |
The plugin doesn't access the location in the background, it is a much requested feature but I have not been able to implement it yet. Can you check if you have the |
We are also having the same issue... We have already removed the permission from the manifest file, sent another patch, but google keeps rejecting the build. |
Good morning everyone, thanks @mvanbeusekom for your consideration. @marcuslindemannrohden I haven't yet managed to release new versions of the application in Play Store without filing an exception, i.e., declaring that the app is not compliant with the new policy. I have not added the ACCESS_BACKGROUND_LOCATION to the manifest, but as far as I understand from this Google resource the permission has been automatically added since we are targeting API versions lower than 29. @mvanbeusekom (and of course this question is addressed to all the users of this library 😊) did you manage to publish or update an application during the month of October? Sharing your experience in this sense would be incredibly helpful! |
Goodmorning @fbambusi, thank you very much for this feedback. I haven't submitted an app to the play store containing this plugin since October yet so I haven't experienced this behavior yet. I will however dive into the material provided and see if I can make sense of it and provide an update here to discuss possible solutions. I am currently working on solving issues #546 and #556, and will pick this up right after (should be somewhere during next week). If someone has any suggestions on a possible solution please let me know, it would be highly appreciated |
I dont remember when i add this permission but i deleted this permission yesterday and submitted app to google. lastly just now google approved my app. |
Hey guys, just got the approval from Google Play. I can not confirm if it really had any impact on the approval but in case anyone needs
|
Hi @fbambusi, @marcuslindemannrohden, @eniserkaya, I have been reading up on this and it seems that the main problem might be that you have to make sure that when listening to the position stream (using the Also note that versions 6.0.0 to 6.1.1 contained a bug which might leave the position stream active if you call the To sum up:
Some more information can be found here:
Little remark on the code that @marcuslindemannrohden removed from the P.S. let me know if this helps out. I have submitted several apps using this plugin to the Google Play Store all without any issues although they don't use the |
Any updates on this? I'm having a hard time getting my app approved Getting the same reply:
I'm only using getCurrentPosition, I'm targeting API level 29 and from what I understand from Developers.android, adding a foreground service type is required for 29 and above. |
@arnerodde365, reading the documentation you provided it seems like all you need to do is add a <!-- Recommended for Android 9 (API level 28) and lower. -->
<!-- Required for Android 10 (API level 29) and higher. -->
<service
android:name="MyNavigationService"
android:foregroundServiceType="location" ... >
<!-- Any inner elements would go here. -->
</service> Note the It would be great if you could give this a try and let me know if this solved the problem. If so I will update the documentation and make sure this is mentioned in the README.md file. |
Yeah I'll let you know I guess this is should be the name of a service from the flutter-geolocator package? |
@arnerodde365 it can be anything you'd like. It is a user defined value so name it something nice ;) |
The app still gets rejected with the same reply :( |
Any update? I have my compile and target SDK versions to 29, did NOT include background-permissions in the AndroidManifest.xml file and in the app bundle explorer it is still showing that I am requesting background location permissions. |
To keep the loop shorter, i would recommend to build the android appbundle via: flutter build appbundle
Running Gradle task 'bundleRelease'... 10.1s
✓ Built build/app/outputs/bundle/release/app-release.aab (132.6MB). Extract the .aab file and lookup the app-release/base/manifest/AndroidManifest.xml This Manifest file should be parsed by the app-store. As long as there exist the entry of The problem here is, that several flutter plugins do introduce this stuff by themself, like the geolocator or the location plugin also. So the discussion point here needs to be changed to how to remove the background location permission entry from the geolocator, in cases where you don't need it. |
Thank you for thinking along @cguentherTUChemnitz, I was also thinking the Therefore I checked all the AndroidManifest.xml files associated with the Geolocator plugin but could not find this particular permission mentioned in the code base. Tomorrow I will run additional tests analyzing the .aab file like you mentioned and try to verify if the Geolocator does put this entry in the AndroidManifest.xml file. |
sorry for the late response, I have got my new version out. |
I can now also confirm, that i was able to use this plugin without ACCESS_BACKGROUND_LOCATION in the bundle's manifest file. In my case another plugin did introduce it in my project. |
@cguentherTUChemnitz thank you very much for confirming this. Would you care to share which plugin was the cause of this issue? This might help others aswel. @arnerodde365, no worries about that, it seems that this issue might be caused by another plugin or package that automatically introduces the I have noticed that this issue has also been raised on the main Flutter repo (see flutter/flutter#73461). |
|
Sadly this information is not really helpful for others. In my case i had this permission in an own non-public plugin, which was used by the same project. |
However, the app is now released and the problem is solved. I think it was a problem with google and their declaration form, I could not get the app in Beta because the Live version was not following the Privacy Policy ... |
@cguentherTUChemnitz and @arnerodde365 thank you for providing the additional feedback. I can now confirm that the Play Store will reject your app if you include the I can also confirm that this is not automatically added by the Geolocator plugin, but could be added by other plugins (e.g. the Location plugin adds it automatically). For those who really need a workaround you can add the following to your AndroidManifest.xml as a direct child of the <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove"/> This will make sure the I am going to close this issue now since I believe it is not caused by the geolocator plugin it self. |
for those who blah blah copy pasted like I did and got: The prefix "tools" for attribute "tools:node" associated with an element type "uses-permission" is not bound. You need to add xmlns:tools="http://schemas.android.com/tools" At the top like: <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.your_app"> This solution comes from: |
Turns out that the Android Platform itself injects the permission: If your app runs on Android 10 or higher but targets Android 9 (API level 28) or lower, the platform applies the following behavior: If your app declares a element for either ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION, the system automatically adds a element for ACCESS_BACKGROUND_LOCATION during installation. |
I've build the official example for geolocator to .apk (signed build) and upload to play store. Problem exists. "Your background location permission declaration needs to be updated. " AndroidManifest.xml is clean - no permissions declared. Beta channel (because baseflow template requires corresponding Dart version). [✓] Flutter (Channel beta, 1.25.0-8.3.pre, on Linux, locale en_US.UTF-8) [skipped] P.S. P.P.S. Yes, I was able to publish official geolocator example to internal testing without errors. I don't delete this post here to allow other users to find this case - maybe it will be useful. |
Even if problem doesn't come from plugin Geolocation, anyone found a solution ? I've got same error : I use only foreground Geolocation, I don't have the permission ACCESS_BACKGROUND_LOCATION in my manifest, but Google Play reject my app.
Thanks for your answer |
🚀 Feature Requests
Good morning everyone! Google has updated Permissions & Location Permissions policies applications must comply with to be published on Google Play.
The new policy restricts the possibility to access users' location in the background: it would be great to have the possibility to access the location in the foreground only.
In particular, it is now necessary to request the ACCESS_BACKGROUND_LOCATION permission in the manifest, and to follow the guidelines provided here.
In case the application is not compliant with the new policy, updates are rejected with error messages similar to this one
Background location access not declared We detected that your app contains at least one feature that requests background location access, however you have not submitted a permission declaration form for this feature. Please log in to your Play Console and submit a declaration form.
Contextualize the feature
There should exist two new functionalities, which could be implemented either by means of new functions or by adding parameters to the existing ones:
Describe the feature
With the proposed modification, the framework should access users' location only when the application is active, without performing any kind of activity when the app is put in background or turned off.
Platforms affected (mark all that apply)
The text was updated successfully, but these errors were encountered: