void RearrageBradeNum() { int notificationCount = UnityEngine.iOS.NotificationServices.scheduledLocalNotifications.Length; List <UnityEngine.iOS.LocalNotification> notifications = new List <UnityEngine.iOS.LocalNotification>(); for (int i = 0; i < notificationCount; i++) { var notification = UnityEngine.iOS.NotificationServices.scheduledLocalNotifications[i]; notification.applicationIconBadgeNumber = i + 1; notifications.Add(notification); } NotificationServices.CancelAllLocalNotifications(); for (int i = 0; i < notifications.Count; i++) { UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(notifications[i]); } }
void OnApplicationPause(bool pauseStatus) { if (Data == null) { return; } if (pauseStatus) { Time.timeScale = 0; #if UNITY_IOS NotificationServices.ClearLocalNotifications(); NotificationServices.CancelAllLocalNotifications(); ScheduleNotification(); #endif PlayerPrefs.SetString("_gameCloseTime", System.DateTime.Now.ToString()); Data.SetAchievementData(AchievementManager.GetAchievementKeeper()); SaveLoadHelper.SaveGame(Data); } else { HandleDroppedMage(); Time.timeScale = 1; #if UNITY_IOS //Debug.Log("Local notification count = " + NotificationServices.localNotificationCount); //if (NotificationServices.localNotificationCount > 0) { // Debug.Log(NotificationServices.localNotifications[0].alertBody); //} // cancel all notifications first. NotificationServices.ClearLocalNotifications(); NotificationServices.CancelAllLocalNotifications(); #endif CalculateIdleIncomeAndShowNotification(); StartCoroutine(WaveManager.SendWave()); } }
public override void CancelAllLocalNotification() { NotificationServices.CancelAllLocalNotifications(); }
public virtual void CancelAllLocalNotifications() { NotificationServices.CancelAllLocalNotifications(); }