When using silent push notifications to create a core data entry such as detailed in chapter 8 , I can make this consistently fail in testing. Initially the task works correctly in all three states [Foreground, background, not running], however if close the app, use another app such as Safari or Mail then send the notification it will fail to write to core data. I have had this issue across multiple different approaches to implement the functionality, even using service extension and handling the write there has the same issue. Any ideas on the issue or a solution?
Using Swift UI
“apns-push-type” : “background”,
“apns-priority” : “5”
“text”: “A test notification”