I am currently testing the NSPersistentCloudKitContainer. I have strictly followed the guidelines of the new documentation. Basically everything works as desired. I use the option NSPersistentStoreRemoteChangeNotificationPostOptionKey on the description to receive Updates from the remote data store. But the updates from the remote database are only delivered if the app is in the foreground. But I would like to update my widget based on a data change in the backend.
Does anyone has an idea how to solve this issues?
What I did so far:
- Background Modes in Capabilities are enabled
- Push Notifications are enabled
- i called registerForRemoteNotifications
- HistoryTracking and RemoteChange Option are enabled on the description of the PersistentStore
Syncing works in foreground ✅
Syncing does not work if App is in Background ❌
Edit: 09.09.2020
It seems that there is nothing that we can do at the moment. Apple Developer Support answered my question some days ago
Thank you for contacting Apple Developer Technical Support (DTS). The behavior and resulting limitations you describe are by design. If you believe an alternative approach should be considered by Apple, we encourage you to file an enhancement request with information on how this design decision impacts you, and what you’d like to see done differently. Although there is no promise that the behavior will be changed, it is the best way to ensure your thoughts on the matter are seen by the team responsible for the decision. While a Technical Support Incident (TSI) was initially debited from your Apple Developer Program account for this request, we have assigned a replacement incident back to your account.