Exemple #1
0
    public void cancelScheduledTypeOfNotifications(ERegisteredNotification typeName)
    {
        if (currentData != null)
        {
            for (int i = currentUser.notifications.Count - 1; i >= 0; i--)
            {
                if (currentUser.notifications [i].templateName == typeName)
                {
                    cancelLocalNotification(currentUser.notifications [i]);
                    currentUser.notifications.RemoveAt(i);
                }
            }

            saveLocalData();
        }
    }
Exemple #2
0
    public string scheduleNotificationByName(ERegisteredNotification notification, double nTime = 0)
    {
        string nID = "";

        for (int i = 0; i < notificationTemplates.Count; i++)
        {
            if (notificationTemplates [i].notificationName == notification)
            {
                CrossPlatformNotification newNotification = notificationTemplates [i].createNotification(nTime);

                nID = scheduleLocalNotification(newNotification);

                currentUser.addNotification(new NotificationJSONData(nID, notification, newNotification.FireDate.ToString("dd-MM-yyyy HH:mm:ss")));
            }
        }

        saveLocalData();

        return(nID);
    }
 public NotificationJSONData(string nID, ERegisteredNotification type, string date)
 {
     ID           = nID;
     templateName = type;
     toAppearDate = date;
 }