ionic-team / ionic-team/capacitor-plugins

[preferences] Sync Preferences over iCloud for iOS

Open
#2,308 0 comments 0 reactions 0 assignees View on GitHub
platform: ios
Dominant language
Java
Stars
678
Forks
685
Avg merge
4d 22h
Merged PRs (30d)
3

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.