March 18, 2016

Unity and permissions in Android 6

I faced with a problem of appearing "ask-permissions" dialog at the starting up of my app.

At first I need to say that I've exported android project and built it manually. I've added few java-libs which use some permissions with protection level "dangerous". I've added them to AndroidManifest as well. My targetSdk parameter is 23. This means I have to ask for permissions at run-time.

I was wondered that "ask-permissions" dialog appeared at the beginning. I spent lot of time trying to understand what happens. As it turned out, Unity brought this behavior as default starting from version 5.2.4.


Well, if you want to disable this feature, solution is very simple.
You need to add this meta-data tag into your AndroidManifest.xml.

<meta-data
    android:name="unityplayer.SkipPermissionsDialog"
    android:value="true"
    />


2 comments: