As NSUbiquitousKeyValueStore
is now available on watchOS 9, I wanted to share values between the iPhone app and the watch app using the key value store.
However, it seems that the watch app creates a separate store with its <app-identifier>.watchkitapp
identifier, so data is not synced between both.
I tried chaning the iCloud Key-Value Store identifier in the watch app's entitlements file. But then signing the app will fail.
Is there any way to use NSUbiquitousKeyValueStore
as a shared store between iPhone and Watch?
What worked for me is changing the "iCloudKey-Value Store" key in the iOS entitlements file to $(TeamIdentifierPrefix)$(CFBundleIdentifier).watchkitapp
The same key in the watchOS entitlements file of course should then be left unchanged as $(TeamIdentifierPrefix)$(CFBundleIdentifier)
No signing issues.