-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christoph Decker
authored and
Christoph Decker
committed
Oct 28, 2024
1 parent
d396ce2
commit 469d671
Showing
2 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Android; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace chdTour.App.Platforms.Android | ||
{ | ||
public class PermissionValidator : Permissions.BasePlatformPermission | ||
{ | ||
public override (string androidPermission, bool isRuntime)[] RequiredPermissions | ||
{ | ||
get | ||
{ | ||
var result = new List<(string androidPermission, bool isRuntime)>(); | ||
if (OperatingSystem.IsAndroidVersionAtLeast(33)) | ||
{ | ||
result.Add((Manifest.Permission.ReadExternalStorage, true)); | ||
result.Add((Manifest.Permission.WriteExternalStorage, true)); | ||
result.Add((Manifest.Permission.MediaContentControl, true)); | ||
result.Add((Manifest.Permission.PostNotifications, true)); | ||
} | ||
return result.ToArray(); | ||
} | ||
} | ||
} | ||
} |