The WCSession class facilitates communication between a WatchKit extension and its companion iOS app. Please only use this tag for questions directly directed at the WCSession class and the WCSessionDelegate protocol. For other questions consider the 'watchconnectivity' or 'watchkit' tags.
Questions tagged [wcsession]
120 questions
24
votes
13 answers
WCSession sendMessage:replyHandler error code 7014 (WCErrorCodeDeliveryFailed)
I have a Watch OS 2 application that communicates with the iOS app via WCSession method sendMessage:replyHandler:errorHandler:
The iOS application reply correctly but time to time I get the error with code 7014 of domain WCErrorDomain: "Payload…

gsempe
- 5,371
- 2
- 25
- 29
19
votes
2 answers
WCErrorCodeDeliveryFailed: Payload could not be delivered
I'm working on an app that share data between iPhone and Apple Watch, using WCSession method sendMessage:replyHandler:errorHandler:
After implementing that method I get the error like:
WCSession _onqueue_notifyOfMessageError:withErrorHandler:…

Aawara
- 301
- 3
- 18
16
votes
1 answer
How big can the payload be when sending data via WatchConnectivity?
When sending data using the WatchConnectivity framework, either from the phone to the watch or vice-versa, how big can the payload be before the framework gives me the WCErrorCodePayloadTooLarge error?
I couldn't find the answer on Apple's…

Andy Ibanez
- 12,104
- 9
- 65
- 100
15
votes
3 answers
WC WCSession counterpart app not installed
Making a connection between iOS and iWatch devices, xCode writes [WC] WCSession counterpart app not installed.
After a lot of research, I've found a solution, maybe it will be helpful for someone.
- Check your WatchKit Extention target.
- Uncheck…

doZer
- 185
- 1
- 8
13
votes
2 answers
How to start main iOS app from companion watch app in background?
Situation:
Since our users have updated their iOS to 11 and/or WatchOS to 4, our iOS app doesn't seem to fire any scheduled timers when the app gets started by our WatchOS app. Maybe we are doing something wrong when starting our main app from the…

Thermometer
- 2,567
- 3
- 20
- 41
12
votes
1 answer
WCSessionDelegate: sessionDidBecomeInactive and sessionDidDeactivate have been marked unavailable, but are required
I just converted a Swift 2 app to Swift 3, using the convert function of Xcode 8.
My code has a class marked as WCSessionDelegate.
In Swift 2 it compiled without the methods sessionDidBecomeInactive and sessionDidDeactivate.
If I compile the…

Reinhard Männer
- 14,022
- 5
- 54
- 116
11
votes
0 answers
What's the best way to sync authentication data between iOS and watchOS?
I've having issues synchronizing user credentials between iOS and watchOS.
My basic set up is that my iOS app and watchOS app both need to talk to a backend server, and they both need an access token to do so. However, the user can only sign in on…

Swupnil Sahai
- 121
- 5
9
votes
2 answers
WCSession's transferUserInfo no longer reliably working in watchOS 2.2 with iOS 9.3
I have an existing iOS 9.2 and watchOS 2.1 app that uses sendMessage and transferUserInfo to send data from the iPhone to the Apple Watch. If sendMessage fails, I am using transferUserInfo to queue the data for later delivery:
// *** In the iOS app…

lehn0058
- 19,977
- 15
- 69
- 109
6
votes
2 answers
Error: "Message reply took too long" - WCSession Watch OS2
So I am using Watch Connectivity to request an array from the iPhone to the Watch.
The idea was to sendMessage from the watch, and the iPhone will reply with the array within the didReceiveMessage method.
However the iPhone does not seem to be…

RileyDev
- 2,950
- 3
- 26
- 61
5
votes
1 answer
How can I diagnose and resolve a crash on WCSession sendMessage(_:replyHandler:errorHandler:)?
I'm building a watchOS app that needs to periodically request information from a companion iPhone app to refresh a complication.
To achieve this, I have a WKApplicationRefreshBackgroundTask that runs periodically. It uses…

gohnjanotis
- 6,513
- 6
- 37
- 57
5
votes
0 answers
watchSession.sendMessage works fine on simulator, times out IRL
I wrote two applications, first using transferUserInfo, which caused too much lag (I believe because it sends stuff in background). I switched to sendMessage and was very happy with the results (faster response time). When attempted to run the…

chriscrutt
- 500
- 3
- 5
- 17
5
votes
1 answer
sessionReachabilityDidChange not called on watch
I would like to have my watch app respond to the parent app on the phone being killed. When the watch app is running and the phone app is killed I get no callback from either sessionReachabilityDidChange or sessionWatchStateDidChange. Based on apple…

Bryan Boyko
- 191
- 1
- 9
5
votes
2 answers
Data is not being transferred from iphone to iWatch (AppleWatch) on real devices
I have an iOS app and I programmed a extension for it on appleWatch.
I'm sending data (NSDictionary) to the appleWatch extension using transferUserInfo method. Everything works in the simulator but when I'm trying to run the application on real…

Rudy.kh
- 86
- 1
- 3
5
votes
2 answers
Is transferCurrentComplicationUserInfo more suitable for complication update?
What is the difference between transferCurrentComplicationUserInfo and transferUserInfo?
I want to send data from my AppDelegate to a clock kit complication.
transferCurrentComplicationUserInfo seems to do exactly the same thing as…

TPeter
- 463
- 3
- 15
5
votes
1 answer
When to call activateSession() on WCSession object
I wonder at what point one would call activateSession() on a WCSession object on the watch and on the iOS device.
In the documentation it says:
Always assign a delegate and activate your session before calling any session-related methods. The…

David Schmoecker
- 567
- 3
- 8
- 17