Some plugins used in Unity require permissions that need a user permission at runtime (like on iOS when the application wants to access the camera of the phone).
Unfortunately Unity does not support it for the moment, and some critical plugins as “obb downloader” (Unity Asset Store - The Best Assets for Game Making) that uses the permission WRITE_EXTERNAL_STORAGE will just make the game crash on Android 6.
Is there any workaround or support planned for Unity 4.6 ?
I have noticed some weird issues also on Android 6 - Nexus 9, but no one commenting on forums if support is added for it yet. I also build game in 4.6.9 latest. Need to know whats happening and if on Unity roadmap?
For now set targetSdkVersion version to anything prior to 23 and you should be fine. The new permission system is only applied for applications with targetSdkVersion 23 or later.
As for plugins, they need to be updated separately. There is nothing we can do on the Unity side to make plugins use the new permission system. Of course the plugins we own we can fix.
If you have fix for the OBB downloader feel free to make pull request.
What is the current status of Android 6 and Permissions? Is this the official work around to target sdk before 23?
I’m on Nexus 5X with Android 6.0. I’ve just upgraded to Unity 5.3.0f4 because of this release note (Why are the issue numbers gone from this release notes!):
Android: Android 6.0 - Ask for any dangerous permission on startup
But the app won’t load any more or ask for any permissions. Is there anything I need to do to enable the permissions to be granted by user manually on startup?
I noticed Unity 5.2.4 has these in the release notes:
Android: Android 6.0 - Ask for any dangerous permission on startup. (739831), (732504)
Android: Fixed querying for custom permissions on Android Marshmallow. (750227)
I checked your above mentioned link and made all the necessary files and folders in my unity project. But I would like to know how to use this csharp script in my application? Do I need to attach it to a empty game object or to a button where I want to ask for permission or which function to call to ask for permissions?
void OnStoragePermissionGranted(bool granted) {
NoodlePermissionGranter.PermissionRequestCallback -= OnStoragePermissionGranted;
if (granted)
// you have external storage permission
else
// you were denied
}