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

[preferences] Sync Preferences over iCloud for iOS #2308

Open
abegehr opened this issue Feb 6, 2025 · 0 comments
Open

[preferences] Sync Preferences over iCloud for iOS #2308

abegehr opened this issue Feb 6, 2025 · 0 comments

Comments

@abegehr
Copy link

abegehr commented Feb 6, 2025

Feature Request

Plugin

@capacitor/preferences

Description

The @capacitor/preferences plugin currently uses UserDefaults on iOS, which is great, as the preferences are stored locally and included in backups. However, the preferences are not synced between user's devices. Even though for most preferences it would probably make sense to sync them for all the user's devices.

Platform(s)

iOS (and all Apple platforms): via NSUbiquitousKeyValueStore: https://developer.apple.com/documentation/foundation/userdefaults
Android: probably has some equivalent?

Preferred Solution

iOS: add support for syncing keys with a specific prefix with NSUbiquitousKeyValueStore: https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore
Tutorial I found: https://www.answertopia.com/ios/synchronizing-ios-key-value-data-using-icloud/

Alternatives

Implement this as a native plugin myself. I would probably do for NSUbiquitousKeyValueStore for iOS, since that's the Apple-approved way to sync preferences between user's devices.

Additional Context

nA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants