21 lines
527 B
C#
21 lines
527 B
C#
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;
|
|
}
|
|
}
|
|
} |