Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from App Extensions to CloudKit without opening the app #39

Open
shumbo opened this issue Mar 27, 2022 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@shumbo
Copy link
Owner

shumbo commented Mar 27, 2022

I intend to use Core Data with CloudKit to sync data between devices. While this works fine on the app, it has problems around app extensions.

Svadilfari Extension (Safari Extension) allows users to add/remove entries to the exclusion list. We expect that the changes are synchronized between devices in a reasonable time. However, the first version of iCloud Sync only uploads changes when the user opens the app.

I tried to use NSPersistentCloudKitContainer from the extension, but it did not upload the changes to the cloud. Moreover, it seemed that the extension created its own copy of the database, and therefore, the changes were not visible from the app.

There are several posts on Apple Developer Forums regarding this issue:

I couldn't get around this. Therefore in the initial version,

  • the Safari extension writes to the shared database on local (using app groups)
  • when users open the app, the changes are uploaded to CloudKit

However, this behavior is not intuitive and ideal. I want app extensions to directly upload changes to CloudKit and have those changes available in other devices without opening the app.

@shumbo shumbo added the help wanted Extra attention is needed label Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant