Closed kyadalu1 closed 10 months ago
@kyadalu1 This is expected behavior due to the logic in https://github.com/godotengine/godot/blob/fbaab3cf537a892295aabdfd02c8052e370e6669/platform/android/java/lib/src/org/godotengine/godot/GodotActivity.kt#L70 which automatically requests runtime permissions when the Godot app starts.
AndroidManifest.xml
- This seems like a bad practice to ask for all runtime permissions as soon as the game loads. A user will feel frustrated to see app asking dangerous permissions at the start without knowing what they are used for.
@kyadalu1 That behavior is being reverted in https://github.com/godotengine/godot/pull/87080.
I expect the change to land in Godot 4.2.2 and Godot 4.3.
- When i go through this, i only see you asking Audio permission, in my case i was asking for location permission. Are all runtime permissions asked at app startup time, of course depending on what i have declared in the
AndroidManifest.xml
It's the opposite, the Audio permission is being excluded from the request; the second argument is an exclude list.
Closing since the PR has been merged.
@m4gr3d Thank you so much for your effort. Really appreciate it.
I am trying to ask the user for runtime location permission, I am asking the permission on button click. Here is my Godot code and here is my android library
As you can see in my Godot code i call
getLocation()
method of my android library on button press but i don't understand why it shows it immediately as soon as my plugin is loaded. If i don't allow the permission and click in the button then as expected my location permission is again asked but i cannot understand why it is asked immediately as soon as the plugin loadsEven in my android library code if you check
GodotAndroidPlugin
class,requestPermissions()
is called ingetLocation()
&getLocation()
is only called on button pressI don't face such issue when i try to use it in my native android app.