Reputation: 320
I have a third party library that uses Unity to do some AR tracking. I normally include this as an AAR module I compile myself from a project I was given.
When run standalone, this library only requests CAMERA permissions. This makes total sense since CAMERA is the only permission declared in the manifest.
However, once integrated to my bigger project, when the UnityActivityPlayer activity is launched, it also requests READ_CONTACTS and CALL_PHONE. These permissions are not included in the library manifest, but they are in my project manifest.
I have singled out the libraries that need these permissions and when not included in the project the extra permissions are not requested at UnityPlayerActivity launch time.
At this point, it seems like UnityPlayerActivity triggers permission requests from these other 2 libraries when the UnityPlayerActivity is launched. Denying these extra permissions won't stop the activity from working fine since they were not needed to begin with.
This is not the expected behavior for runtime permissions. My understanding is that they should requested when they're needed, in this case, they should be requested by the activity/fragment that will use them, not at this other random time. But UnityPlayerActivity seems to behave differently from other activities.
Right now, we're trying to make UnityPlayerActivity stop from asking these permissions that are not needed at that time. Has anybody encountered something similar or have a clue on how to go about this?
Upvotes: 0
Views: 482
Reputation: 100
try to add this like to skip Unity Permissions on your Manifest between application tags.
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
I guess it' s your solution.
Greetens
Upvotes: 1