Hi all,
I've been busy with an iOS app with an watchkit app on it's side.
Basically it just pulls the UDID from the watch, and sends it over to the iPhone by a press on the button.
It did work, but since I changed to a new watch and phone and iOS updates it keeps giving me "[WC] WCSession has not been activated"
I've read somewhere to retry the activation after several seconds so I use an timer to do it for me after a second.
The Watch doesn't give any error, just no response on sendMessage. The message comes from the phone.
The watch is paired etc, I also receive my notifications and apps etc on my watch.
Anyone know whats going on here?
iPhone:
Apple Watch:
I've been busy with an iOS app with an watchkit app on it's side.
Basically it just pulls the UDID from the watch, and sends it over to the iPhone by a press on the button.
It did work, but since I changed to a new watch and phone and iOS updates it keeps giving me "[WC] WCSession has not been activated"
I've read somewhere to retry the activation after several seconds so I use an timer to do it for me after a second.
The Watch doesn't give any error, just no response on sendMessage. The message comes from the phone.
The watch is paired etc, I also receive my notifications and apps etc on my watch.
Anyone know whats going on here?
iPhone:
Code:
...
viewDidApear
checkWatch()
...
func checkWatch() {
if (WCSession.isSupported()) {
session = WCSession.default
session.delegate = self;
if(session.isReachable) {
if(session.isComplicationEnabled) {
if(session.isPaired != true) {
NSLog("not paired")
} else if(session.isWatchAppInstalled != true) {
NSLog("Not installed on watch!")
} else {
session.activate()
}
} else {
NSLog("Is not complication enabled!")
}
} else {
NSLog("Session not reachable!?")
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false, block: { timer in
print("CHECK WATCH AGAIN")
self.checkWatch()
})
}
} else {
NSLog("WatchConnectivty Not supported")
}
}
Apple Watch:
Code:
...
willActivate
if (WCSession.isSupported()) {
NSLog("session supported..")
session = WCSession.default
session.delegate = self
session.activate()
}