Using unity’s mobile notifications package and the samples with it.
If I schedule a notification, minimize the app, the notification works fine.
If I schedule a notification, minimize the app, re-enter the app, minimize it again, the notification isn’t fired.
The operating mode from the GameNotificationsManager is set to QueueClearAndReschedule, so the above scenario should be covered, in theory. When scheduling a notification via GameNotificationsManager.ScheduleNotification(), I am setting .Reschedule to true on the returned PendingNotification instance.
I was just banging my head against a weird behavior where every time my application loses and re-gains focus, the DeliveryTime of my notification seems to advance 7 hours into the future.
I’m testing by looping over GameNotificationsManager.PendingNotifications, and logging pendingNotification.Notification.DeliveryTime
I may be doing something wrong, but it almost seems like time zone shenanigans? I can’t track down where in my code, or the mobile notification package, the 7 hours could be getting introduced.
sounds good! it’ll be interesting if the same thing is happening to you. I also cross posted this thread [here]( Mobile Notification Package page-13#post-7920403) in case someone has ideas.
I am seeing a similar issue now too. Notifications on ios seem to have the delivery time changed immediately after it being set (in my case, -10 hours, which makes sense because I’m +10 GMT). This usually results in the notification immediately being dequed because it is “expired”.
Just had a quick look through the ios notification code, and there are some ToUTC and ToLocal scattered about, so something is going wrong somewhere. Time permitting, I’ll try track down the issue.
I ran into the same issue when I updated from Unity 2020.17 to 2020.3.31f. Not sure exactly what is causing the error, but here’s a temp workaround I wrote for iOS notification schedule. The idea was just to add the difference if the timezone is set wrong which results in the correct actual time scheduled on iOS.