I’m attempting to get local notifications working on iOS and having a heck of a time, any help would be appreciated.
I first call:
UnityEngine.iOS.NotificationServices.RegisterForNotifications(
UnityEngine.iOS.NotificationType.Alert |
UnityEngine.iOS.NotificationType.Sound);
Then:
UnityEngine.iOS.LocalNotification localNotification = new UnityEngine.iOS.LocalNotification();
localNotification.alertAction = notificationParams.Title;
localNotification.alertBody = notificationParams.Message;
localNotification.fireDate = DateTime.Now.AddSeconds(notificationParams.Delay.TotalSeconds);
localNotification.userInfo = new Dictionary<int, int>(1);
localNotification.userInfo.Add(notificationParams.Id, notificationParams.Id);
UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(localNotification);
To try to clear the notification from the tray:
UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
I’ve also tried:
loop id:
UnityEngine.iOS.NotificationServices.CancelLocalNotification(id)
I get the local notifications to fire, I just can’t clear them so they stay in the “Tray” or whatever it is called, any ideas?
TIA