-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: CheckPermission now returns bool + added async varia…
…nts of RequestPermission functions that don't freeze the app unnecessarily (fixed #14)
- Loading branch information
Showing
8 changed files
with
73 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
Plugins/AndroidRuntimePermissions/Editor/ARPPostProcessBuild.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
Plugins/AndroidRuntimePermissions/Editor/ARPPostProcessBuild.cs.meta
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
= Android Runtime Permissions = | ||
= Android Runtime Permissions (v1.2.0) = | ||
|
||
Online documentation & example code available at: https://github.com/yasirkula/UnityAndroidRuntimePermissions | ||
E-mail: [email protected] | ||
|
||
1. ABOUT | ||
This plugin helps you query/request runtime permissions synchronously on Android M and later. | ||
This plugin helps you query/request runtime permissions on Android M and later. | ||
|
||
2. HOW TO | ||
You can use the following static functions of AndroidRuntimePermissions to manage runtime permissions: | ||
|
||
- Permission CheckPermission( string permission ): checks whether or not the permission is granted. Permission is an enum that can take 3 values: | ||
- bool CheckPermission( string permission ): checks whether or not the permission is granted | ||
|
||
- bool[] CheckPermissions( params string[] permissions ): queries multiple permissions simultaneously. The returned array will contain one entry per queried permission | ||
|
||
- Permission RequestPermission( string permission ): requests a permission from the user and returns the result. It is recommended to show a brief explanation before asking the permission so that user understands why the permission is needed and doesn't click Deny or worse, "Don't ask again". Permission is an enum that can take 3 values: | ||
-- Granted: permission is granted | ||
-- ShouldAsk: permission is not granted yet, but we can ask the user for permission via RequestPermission function. As long as the user doesn't select "Don't ask again" while denying the permission, ShouldAsk is returned | ||
-- ShouldAsk: permission is denied but we can ask the user for permission once again. As long as the user doesn't select "Don't ask again" while denying the permission, ShouldAsk is returned | ||
-- Denied: we don't have permission and we can't ask the user for permission. In this case, user has to give the permission from app's Settings. This happens when user selects "Don't ask again" while denying the permission or when user is not allowed to give that permission (parental controls etc.) | ||
|
||
- Permission[] CheckPermissions( params string[] permissions ): queries multiple permissions simultaneously. The returned array will contain one Permission entry per each queried permission | ||
- Permission[] RequestPermissions( params string[] permissions ): requests multiple permissions simultaneously | ||
|
||
- Permission RequestPermission( string permission ): requests a permission from the user and returns the result. It is recommended to show a brief explanation before asking the permission so that user understands why the permission is needed and doesn't click Deny or worse, "Don't ask again" | ||
- Task<Permission> RequestPermissionAsync( string permission ): asynchronous version of RequestPermission. Unlike RequestPermission, this function doesn't freeze the app unnecessarily before the permission dialog is displayed | ||
|
||
- Permission[] RequestPermissions( params string[] permissions ): requests multiple permissions simultaneously | ||
- Task<Permission[]> RequestPermissionsAsync( string[] permissions ): asynchronous version of RequestPermissions | ||
|
||
- void OpenSettings(): opens the settings for this app, from where the user can manually grant permission(s) in case a needed permission's state is Permission.Denied |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters