Skip to content

Add PermissionManager for Android

With this issue #32162 (closed) I have implemented PermissionManager to Godot core. You can request permission/permissions and check it's granted status. This implementation only about with Android and you will get "true" while request permission/s, "false" for check permission from other platforms. I added all existing permissions in Godot export list and mapping with index(Permission enum). If everything looks good, I will add documentation. You can find sample project in repo and I left a code snippet down.

var permission_array: PoolIntArray = []
permission_array.append(PermissionManager.ACCESS_FINE_LOCATION)
permission_array.append(PermissionManager.WRITE_EXTERNAL_STORAGE)
PermissionManager.request_permissions(permission_array)

PermissionManager.request_permission(PermissionManager.CAMERA)

var granted = PermissionManager.check_permission(PermissionManager.CAMERA)
print("CAMERA granted status: ", granted)

Merge request reports

Loading