Created
January 14, 2019 11:51
-
-
Save LoriBru/113f1cd57aa5b304d3a6994935c781ac to your computer and use it in GitHub Desktop.
Checking app permissions.
This file contains hidden or 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
| private void CheckAppPermissions() | |
| { | |
| if ((int)Build.VERSION.SdkInt < 23) | |
| { | |
| return; | |
| } | |
| else | |
| { | |
| if (Context.CheckSelfPermission(Manifest.Permission.ReadExternalStorage) != Permission.Granted | |
| && Context.CheckSelfPermission(Manifest.Permission.WriteExternalStorage) != Permission.Granted) | |
| { | |
| var permissions = new string[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage }; | |
| RequestPermissions(permissions, 1); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment