Adding final project to dev branch
This commit is contained in:
21
WguApp/Services/PermissionsService.cs
Normal file
21
WguApp/Services/PermissionsService.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Plugin.LocalNotification;
|
||||
|
||||
namespace WguApp.Services;
|
||||
|
||||
public static class PermissionsService
|
||||
{
|
||||
public static async Task<bool> CheckNotificationPermissions()
|
||||
{
|
||||
if (await LocalNotificationCenter.Current.AreNotificationsEnabled()) return true;
|
||||
|
||||
try
|
||||
{
|
||||
return await LocalNotificationCenter.Current.RequestNotificationPermission();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerService.LogToFile(e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user