Exemplo n.º 1
0
        public void scheduleLocalNotification(LocalNotificationData notificationData)
        {
            if (!isInitialized)
            {
                return;
            }
            var timeSpan    = TimeExtensions.hoursToTimeSpan(notificationData.triggerInHours);
            var timeTrigger = new iOSNotificationTimeIntervalTrigger()
            {
                TimeInterval = timeSpan,
                Repeats      = notificationData.isRepeatingNotification
            };

            notificationData.utcScheduledTime = TimeExtensions.currentUtcTime.Add(timeSpan);
            iOSNotification notification = createNotification(notificationData, timeTrigger);

            iOSNotificationCenter.ScheduleNotification(notification);
        }
 public void scheduleLocalNotification(LocalNotificationData notificationData)
 {
     if (isInitialized)
     {
         if (!notificationData.isRepeatingNotification)
         {
             Manager.Instance.ScheduleNotification(notificationData.triggerInHours.hoursToSeconds(),
                                                   notificationData.title, notificationData.text, notificationData.id,
                                                   notificationProfile: notificationData.profile, badgeNumber: notificationData.badge);
         }
         else
         {
             Manager.Instance.ScheduleNotificationRepeating(notificationData.triggerInHours.hoursToSeconds(),
                                                            notificationData.intervalInHours.hoursToSeconds(), notificationData.title, notificationData.text,
                                                            notificationData.id, notificationProfile: notificationData.profile, badgeNumber: notificationData.badge);
         }
         var timeSpan = TimeExtensions.hoursToTimeSpan(notificationData.triggerInHours);
         notificationData.utcScheduledTime = TimeExtensions.currentUtcTime.Add(timeSpan);
     }
 }
Exemplo n.º 3
0
        private static void updateScheduledTime(LocalNotificationData notificationData)
        {
            var timeSpan = TimeExtensions.hoursToTimeSpan(notificationData.triggerInHours);

            notificationData.utcScheduledTime = TimeExtensions.currentUtcTime.Add(timeSpan);
        }