Пример #1
0
        void SetNotifications()
        {
            ILocalDataStore LocalDataStore = DependencyService.Get <ILocalDataStore>();

            if (!LocalDataStore.GetNotificationsSettings())
            {
                return;
            }

            var minutesAhead  = LocalDataStore.GetNotificationsMinutes();
            var message       = minutesAhead > 0 ? $"Začiatok zápasu o {minutesAhead} min." : "Začiatok zápasu.";
            var notifications = LocalDataStore.GetNotificationMatches();

            foreach (var not in notifications)
            {
                Plugin.LocalNotifications.CrossLocalNotifications.Current.Cancel(not.MatchId);
            }
            foreach (var not in notifications)
            {
                if (not.DateTime.HasValue)
                {
                    Plugin.LocalNotifications.CrossLocalNotifications.Current.Show(not.MatchName, message, not.MatchId, not.DateTime.Value.AddMinutes(-minutesAhead));
                }
            }
        }