Godot Version
Godot 4.2
Question
I’m making an Android App with Godot 4.2.
In it there’s a functionality that saves and writes files in the phone’s external storage. That much is already working.
However, Android’s policies only allow the App to access files created by the current installation of the app. To access all the files I have to ask the permission to “Manage External Storage”. If I select this permission on the export page, as soon as the App is opened the user is prompted to allow it, and everything works as it should it the user allow it.
The problem is two-fold:
- I don’t want to ask permission as soon as the app is opened. I want to ask only when/if relevant, i.e. if the user tries to use the file explorer functionality. This funcionality is not necessary for the main use of the app, and the user may never even have to use it. So I don’t want to bother the user with an invasive permission upfront.
- If the user denies the permission, how do I ask for it again when it’s actually needed?
I usedOS.get_granted_permissions()
to verify if the permission was granted and either way a call toOS.request_permission()
doesn’t do anything.
Any help is appreciated. Thanks