Camera access permission check

Recent iOS and Android systems both ask the user to allow/deny camera access. That’s fine, but how can I check for this in Unity? I need to be able to do something like…if (Blah.Permissions.Camera == Denied) and it needs to work on both iOS and Android.

Anyone know how to do this?

You could access AndroidManifest.xml to get permissions for android. I don’t know anything about IOS so I don’t know what you could do for that.

Android Manifest:
C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer to [your game]/Assets/Plugins/Android

Just parse through the permissions using your favorite XML library.

I don’t have an issue getting Android to use the camera. That’s not the issue. The issue is that in recent versions of mobile OS’s…they ask to allow/deny those privileges after you’re already running the app. “So and so app is trying to access your camera. Is that ok?”