We have a requirement to save the push notification while the app is in active or killed state, and later show all these saved notification in a view controller when ever user wants.
Could anyone help me with other optimal approach around this?
Few that I could think of were:
Save it to user defaults, and when app launches or when user goes to the notification controller, move the data to Core Data and clear the user defaults. I was also thinking of limiting background saving to user defaults to be 10.
App groups. Using core data in notification service extension. We were facing issues with accessing App Delegate from this notification service extension
Please note, the notification cannot be sent by the server. Also, I am curious about the scenario where app can be unused for few weeks but notifications will keep coming.