void RemoveAllNotifications() { #region Android #if UNITY_ANDROID string raw = PlayerPrefs.GetString("NotificationIDs"); if (!string.IsNullOrEmpty(raw)) { notification_ids = raw.Split(',').Select(x => x.Split(':')).ToDictionary(x => x[0], x => int.Parse(x[1])); } else { return; } foreach (var key in notification_ids.Values) { AndroidLocalNotification.CancelNotification(key); } notification_ids.Clear(); PlayerPrefs.DeleteKey("NotificationIDs"); #endif #endregion #region iOS #if UNITY_IOS NotificationServices.CancelAllLocalNotifications(); #endif #endregion }
private void cancelNotification() { NotificationManager.CancelAll(); //LocalNotification.ClearNotifications(); #if UNITY_IOS NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); #endif }
public void ClearNotification() { #if UNITY_IOS LocalNotification l = new LocalNotification(); l.applicationIconBadgeNumber = -1; NotificationServices.PresentLocalNotificationNow(l); NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); #endif }
public void DisableNotify() { #if UNITY_ANDROID AndroidNotificationManager.Instance.CancelAllLocalNotifications(); ReceivePushNotifications = false; #endif #if UNITY_IOS Notification.CancelAllLocalNotifications(); ReceivePushNotifications = false; #endif }
/// <summary> /// Uklanja sve setovane lokalne notifikacije (Samo IOS) /// </summary> public void CancelAllNotifications() { #if UNITY_IOS && !UNITY_EDITOR //Empty notification to clear badge number LocalNotification l = new LocalNotification(); l.applicationIconBadgeNumber = -1; NotificationServices.PresentLocalNotificationNow(l); NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); NotificationServices.ClearLocalNotifications(); #endif }
public static void ClearNotification() { #if UNITY_IOS mIconBadgeNumber = 0; CancelAllLocalNotifications(); ClearLocalNotifications(); LocalNotification localNotification = new LocalNotification(); localNotification.applicationIconBadgeNumber = -1; NotificationServices.PresentLocalNotificationNow(localNotification); NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); #endif }
public void ClearNotifications() { if (!isCleared) { #if UNITY_IOS NotificationServices.CancelAllLocalNotifications(); #endif #if UNITY_ANDROID Assets.SimpleAndroidNotifications.NotificationManager.CancelAll(); #endif isCleared = true; } }
// Call by main game OnApplicationPause public void ClearAllNotifications() { #if UNITY_ANDROID NotificationManager.CancelAll(); #elif UNITY_IOS if (NotificationServices.localNotificationCount > 0) { //foreach (LocalNotification notification in NotificationServices.localNotifications) //{ // Debug.Log("INCOME ALERTS: " + notification.alertBody); //} } // cancel all notifications first. NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); #endif }
private void ClearNotify() { if (0 < NotificationServices.localNotificationCount) { var localNotification = new LocalNotification(); localNotification.applicationIconBadgeNumber = -1; NotificationServices.PresentLocalNotificationNow(localNotification); } if (NotificationServices.scheduledLocalNotifications.Any()) { NotificationServices.CancelAllLocalNotifications(); NotificationServices.ClearLocalNotifications(); } }
public void CancelAllLocalNotification() { #if UNITY_IOS NotificationServices.CancelAllLocalNotifications(); #endif }
public static void CancelAllNotifications() { NotificationServices.CancelAllLocalNotifications(); }