David Robertson
David Robertson

Reputation: 1581

watchOS2 and iOS8 connectivity - Swift

For watchOS1 there were several limited, but efficient methods available for sharing data between the watch and the phone - like openParentApp, AppGroups and NSUserDefaults.

With the release of watchOS2 and the WatchConnectivity framework - openParentApp method was deprecated, AppGroups and NSUserDefaults were limited to read-only functionality. Important to note here that WatchConnectivity is supported only by iOS9 devices.

But somehow i see apps on the AppStore claiming to be optimised for watchOS2 while having an iOS8 as deployment target.

Am i missing something? Are there any other methods available for sharing data sufficiently?

Upvotes: 3

Views: 591

Answers (1)

jeeeyul
jeeeyul

Reputation: 3787

Some user may not have Apple Watch and they may using iOS8. To support them, You can set each deployment target version per each build target.

Likes these example targets in a project:

  • iOS App (target: iOS 8.x, You must set WatchConnectivity framework as optional)
  • watchOS 2 App (target: iOS 9.x & watchOS 2) -> iOS8 User can't install watch app.
  • watchOS 2 App Exntension (target: iOS 9.x & watchOS 2)

In the iOS App Codes, You can check WatchConnectivity availability with below codes:

NSClassFromString(@"WCSession") != nil;

As far as I know, You can also provides watchOS 1 App in sametime, But I did not test it. It can't be tested with simulator and I don't have other apple watch that have watchOS1.

Upvotes: 2

Related Questions