Why does unity ask at app start up for storage permission even if I need the storage permission later in my game? (using Unity 5.3) is there any way to disable this and let me ask for it when I need it? android unity3d
This is the way they are handling it, because they can't ensure that plugins ask for the permissions and they prefer to ask for all the permissions at start instead of each time you need it. They say can't do another way. You can read this topic to learn more: http://forum.unity3d.com/threads/unity-bug-fix-problem-android-6-urgent.367681/ there is a tag to disable it.
hmm but that post refers to unity 4.6 ? (I am using 5.3) think it's a separate issue, also in unity 5.0.4 this was not an issue and it worked perfectly as it did not ask for any permission. Also on Android you have to handle this anyway, because a user can always deny that permission ...
Yup because you probably updated the Android SDK. Unity detected that you used the last sdk to build and added permission dialog to your build. This is the same implementation for Unity 4.6 and Unity 5.3. We never had the problem here because we haven't updated the sdk so we are still on an sdk that doesn't handle the permissions. If you didn't pushed your apk with permissions on Google Play you can still go back to the old sdk(files are probably somewhere on internet)
hi, yes on play it does have target 23 and can't turn back, but when I uploaded on play I used unity 5.0.4 and works ok there. (does not ask for any permission at app start and I can ask for it when I need it)... so I would think this is some kind of bug introduced in unity 5.3.1
unity should not ask for the storage permission until I need it, the idea behind runtime permissions is to request them when you need them and not all at app start ... unity 5.3 requests storage permission at app start even if I don't need it then
I know they are not using the permissions as Google say, but understand them, how can they know what a Plugin will do? For exemple is the Java plugin access storage directly from the plugin and not from the Unity code, they can't know that. So they made it this way to avoid "code kiddies" complaining that plugins doesn't work correctly because they don't know that the plugin must asks for permission. Do you understand?
This is correct. If you run Unity 5.0 with API level 23 installed, then you will have no dialog, and all the permissions actually denied. In 5.3, you will get a dialog on startup. What @r.pedra says is all correct. Please refer to the thread http://forum.unity3d.com/threads/unity-bug-fix-problem-android-6-urgent.367681/ for more details, or feel free to ask additional questions there.
As Yury mentioned, check out that thread, it will explain the situation in more detail. However, if you want to stop the dialog you can use the special meta tag Unity added to suppress it. Code (XML): <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" /> Beware, though, that this will allow you to proceed with dangerous permissions denied. As it did in pre-Unity 5.3 I believe. The intent behind this tag is that you will handle it yourself and ask for the relevant permissions at run-time when you need them.
Sorry what I meant is that unity should not ask for storage permissions unless it needs it, (since storage permission is optional can't see why unity would need it at app start), I should be able to add storage permission in the manifest and unity should ignore it, as I want to use my own plugin to ask for the permission and also explain to the user why I need it when I need it, and if I don't ask for the permission app should just crash ... should be the developers choice when to ask for them ... that was the point of runtime permissions