diff --git a/LocalNotifications/LocalNotifications/LocalNotifications.Android/AndroidNotificationManager.cs b/LocalNotifications/LocalNotifications/LocalNotifications.Android/AndroidNotificationManager.cs index 43487edb3c..ad3e3c5544 100644 --- a/LocalNotifications/LocalNotifications/LocalNotifications.Android/AndroidNotificationManager.cs +++ b/LocalNotifications/LocalNotifications/LocalNotifications.Android/AndroidNotificationManager.cs @@ -70,7 +70,7 @@ public void SendNotification(string title, string message, DateTime? notifyTime PendingIntent pendingIntent = PendingIntent.GetBroadcast(AndroidApp.Context, pendingIntentId++, intent, PendingIntentFlags.CancelCurrent); long triggerTime = GetNotifyTime(notifyTime.Value); - AlarmManager alarmManager = GetAlarmManager(); + AlarmManager alarmManager = AndroidApp.Context.GetSystemService(Context.AlarmService) as AlarmManager; alarmManager.Set(AlarmType.RtcWakeup, triggerTime, pendingIntent); } else @@ -106,12 +106,6 @@ void CreateNotificationChannel() channelInitialized = true; } - AlarmManager GetAlarmManager() - { - AlarmManager alarmManager = Android.App.Application.Context.GetSystemService(Context.AlarmService) as AlarmManager; - return alarmManager; - } - long GetNotifyTime(DateTime notifyTime) { DateTime utcTime = TimeZoneInfo.ConvertTimeToUtc(notifyTime); diff --git a/LocalNotifications/LocalNotifications/LocalNotifications.iOS/iOSNotificationManager.cs b/LocalNotifications/LocalNotifications/LocalNotifications.iOS/iOSNotificationManager.cs index 9d3b64ae74..8a018e4995 100644 --- a/LocalNotifications/LocalNotifications/LocalNotifications.iOS/iOSNotificationManager.cs +++ b/LocalNotifications/LocalNotifications/LocalNotifications.iOS/iOSNotificationManager.cs @@ -9,7 +9,6 @@ namespace LocalNotifications.iOS public class iOSNotificationManager : INotificationManager { int messageId = 0; - bool hasNotificationsPermission; public event EventHandler NotificationReceived; diff --git a/LocalNotifications/Screenshots/local-notifications-msg.png b/LocalNotifications/Screenshots/local-notifications-msg.png index 8eafc2d0b5..72b42bf2c4 100644 Binary files a/LocalNotifications/Screenshots/local-notifications-msg.png and b/LocalNotifications/Screenshots/local-notifications-msg.png differ