private void ScheduleNotification(object obj) { NotificationScheduleDB = new NotificationScheduleDB(); ScheduleNotifications(); NotificationScheduleDB.SetNextNotificationTime(); DependencyService.Get <ILocalNotifications>().SendLocalNotification(); }
public override void OnReceive(Context context, Intent intent) { NotificationDB = new NotificationScheduleDB(); var ScheduledNotifications = NotificationDB.GetNextNotifications(); foreach (NotificationSchedule ScheduledNotification in ScheduledNotifications) { Bundle Data = GetDataBundle(ScheduledNotification); var NotificationIntent = GetLaunchIntent(Data); PendingIntent ContentIntent = PendingIntent.GetActivity(Application.Context, 0, NotificationIntent, PendingIntentFlags.UpdateCurrent); var Notification = GetNotification(ScheduledNotification, ContentIntent); var NotificationManager = NotificationManagerCompat.From(Application.Context); NotificationManager.Notify(ScheduledNotification.ID, Notification); } }