This was NOT a problem on watchOS 1, but now on watchOS 2 I cannot read the values on the watch extension.
According to Apple docs, it is possible. According to some people on this thread, it is possible. According to an Apple employee on this thread, it is possible.
I'm setting everything up correctly as far as I can tell:
- I enabled App Groups on both iOS app and watch extension with the same identifier.
- I added Settings-Watch.bundle to the iOS app
and added the
ApplicationGroupContainerIdentifier
with the same identifier to the plist
When I initialize an NSUserDefaults
object with the identifier as the suite name, I cannot read values on the watch extension. I can read them on the iOS app. This happens in simulator and real device.
Please DON'T post an answer about how to do this with Watch Connectivity. It is possible to do this with just Shared App Groups on watchOS 2 without Watch Connectivity, people are able to do it, and here it is straight out of the docs:
In watchOS 2, your WatchKit extension may read the values of preferences, but you cannot write new values. Preferences in watchOS 2 are forwarded from iOS to Apple Watch, but any modifications you make are not sent back to iOS.