Indrajit Chavda
Indrajit Chavda

Reputation: 361

how to share data between watch and iphone in xcode 8

Before xcode 8 - i was using following code, but it is not working now- delegate method from watch side is not getting called

if WCSession.isSupported() {
        let watchSession = WCSession.defaultSession()
        watchSession.delegate = self
        watchSession.activateSession()
        if watchSession.paired && watchSession.watchAppInstalled {
            do {
                try watchSession.updateApplicationContext(["key1": "value1"])
            } catch let error as NSError {
                print(error.description)
            }
        }
    }

in above code if condition is not being satisfied.

Upvotes: 1

Views: 208

Answers (1)

ak sacha
ak sacha

Reputation: 2179

make sure you have turned on the group feature in both target (watch's & mobile's)

Upvotes: 2

Related Questions