⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

enum PermissionState

Permissions can be in a variety of states, depending on how users interact with them. Sometimes they’re automatically granted, user denied, or just unknown for the current runtime! A positive value means you’re clear to use the feature, zero or negative means you’re not.

Enum Values

   
Blocked The permission was refused, and the system will not prompt for it again. Requesting it is legal, but nothing will happen. Only the user can undo this, from the system’s settings. Work without the feature, and if it matters, tell the user where to turn it back on.
Capable This app can use the permission, but hasn’t been granted it yet. Ask for it with Permission.Request.
Denied The permission was refused, but the system is still willing to prompt for it. Not every platform has this state; where the first refusal is final, you’ll get blocked instead. You can request it again, ideally at a moment where the user understands why you need it.
Granted This permission is entirely approved and you can go ahead and use the associated features!
Requesting A permission request is in flight: a dialog may be up, or StereoKit is waiting to see if the system will answer one. This settles on its own once the system answers, or the user dismisses the dialog. Wait, and check back later.
Unavailable StereoKit knows this permission, but nothing you do at runtime can get it granted. Usually the permission string is missing from the AndroidManifest.xml or equivalent, so check there first. Some runtimes also report this when an administrator or parental control has locked the feature off, which no amount of asking will change. Fix your app’s manifest, or work without the feature.
Unknown StereoKit doesn’t know about the permission on the current runtime. This happens when the runtime has a unique permission string (or not) and StereoKit doesn’t know what it is to look up its current status. There’s no reliable action here, try the feature and see if it works.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!