I have built a Core Data app which contains a bunch of cookies and their ingredients.
If the user elects to allow it, once each week the app sends a Notification suggesting a cookie to make.
I have everything working well, but I cannot randomize the cookie displayed unless the user closes and opens the app and triggers the generation of a new UNMutableNotificationContent instance inside AppDelegate.
I understand why this is happening, of course. The call to UNUserNotificationCenter.current().add() for the UNNotificationRequest is inside AppDelegate's didFinishLaunchingWithOptions function, so it won't be called unless the app is closed and then opened again, even though the UNCalendarNotificationTrigger is set to repeating. There's no way to assign a new cookie to UNMutableNotificationContent unless the process happens again.
But surely this must be something that other developers have solved already.
Any ideas?