Skip to content

Commit 68df1b6

Browse files
committed
Also clear cache
1 parent 6e4dcef commit 68df1b6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

com.unity.mobile.notifications/Tests/Runtime/Android/AndroidNotificationSendingTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ public IEnumerator SendNotification_CanReschedule()
320320
// temporary null the manager, cause that's what we have in reality
321321
var manager = managerClass.GetStatic<AndroidJavaObject>("mUnityNotificationManager");
322322
managerClass.SetStatic<AndroidJavaObject>("mUnityNotificationManager", null);
323+
// also clear cached notifications, since they don't exist after reboot
324+
managerClass.GetStatic<AndroidJavaObject>("mScheduledNotifications").Call("clear");
323325

324326
// simulate reboot by directly cancelling scheduled alarms preserving saves
325327
managerClass.CallStatic("cancelPendingNotificationIntent", context, id);

0 commit comments

Comments
 (0)