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
2
votes
0 answers
Share Authentication Headers from iPhone to Apple Watch
Users log in on their iPhone into our app.
After that we securely store the authentication information in the keychain. Our users don't have to sign in each and every time they use the app.
Now we are adding a Watch app. We would like to do some…

Bocaxica
- 3,911
- 3
- 37
- 54
2
votes
0 answers
WCSession: Data submitted on iOS is never received on the Watch
I am working on a small time tracking app for iOS. The user can create any number of activity and then track how much time he spend on each of them (e.g. sleeping, driving to work, eating, working, etc.)
Now I would like to add Apple Watch support:…

Andrei Herford
- 17,570
- 19
- 91
- 225
2
votes
1 answer
watchOS background task crashes on setTaskCompleted
In my watch extension delegate init function, I set up KVO observers on the WCSession:
if WCSession.isSupported() {
let defaultSession = WCSession.default
defaultSession.addObserver(self, forKeyPath: "activationState",
…

Reinhard Männer
- 14,022
- 5
- 54
- 116
2
votes
1 answer
Can the iPhone App respond to file transferred via Apple watch if it is inactive?
I am developing an apple watch application which records an audio file, saves it and then transfers the file URL to the iPhone app via WCSession (Watch Connectivity framework). My code looks like this
In InterfaceController.m
NSURL *directory =…

Ellyn_Philip
- 185
- 8
2
votes
1 answer
Watch App: [WCSession defaultSession].isReachable is always retrieve 'FALSE' status on background app?
I am developing apple watch application. when app on foreground it is working fine [WCSession defaultSession].isReachable and retrieve ON status. Now my watch application is goes to background mode then problem must be create.
so how to resolve this…

BuLB JoBs
- 841
- 4
- 20
2
votes
1 answer
WKExtension state and sendMessage for Live messaging
I'm developing a WatchApp that needs to communicate with the iOS App and I'm using the Watch Connectivity fwk to do that.
Each time the user displays my WatchApp I need to get from the iOS App a new set of data that must be displayed on the…

sebastien
- 2,489
- 5
- 26
- 47
2
votes
1 answer
How to identify different connected watches in iOS
From watchOS >= 2.2, iOS >= 9.3 iOS device is able to connect with multiple watch devices via sessionDidDeactivate:, sessionDidBecomeInactive:.
However there is no identity provided in these delegate calls.
Is there any system way to identify…

Sang
- 4,049
- 3
- 37
- 47
2
votes
0 answers
iOS and counterpart Complication not communicating with each other
The basic concept of my App is that the Complication requests the iPhone for data and the iPhone then sends the data back.
I activate my WCSession from my iPhone App in the didFinishLaunchingWithOptions. Also in my Watch app I've overwritten the…

ph1psG
- 568
- 5
- 24
2
votes
2 answers
WatchKit InterfaceController conditionally play haptic in sendMessage:replyHandler:
I want to make the interface controller check to make sure it is still in the foreground when I get a reply from the phone. If it is, perform a haptic to let the user know it finished working.
sendMessage:replyHandler: is what I am using to…

Charlie
- 1,279
- 2
- 12
- 28
2
votes
1 answer
How to support multiple watches for iOS 9.3 and watchOS 2.2
Having trouble figuring out how to update my watch and iOS apps for watchOS 2.2 in order to support multiple watches.
I know there are new functions that must be implemented primarily on the iOS app side, but also on the watch extension according to…

mackymoo
- 95
- 1
- 4
2
votes
1 answer
WCSession issue with Xcode 7.3
Helo
Before updating Xcode to the 7.3 version I had an app with an WatchOS 2 app, The watch app would call the func session(session: WCSession, didReceiveUserInfo userInfo: [String : AnyObject]) {
and the iOS app would pick the call and insert the…

hsn
- 173
- 2
- 10
2
votes
2 answers
watchOS WCSession 'paired' and 'watchAppAvailable' are unavailable
I am trying to use a singleton to manage WCSession messages, which I found here.
I understand what it is trying to do, but i don't understand why I am getting an error... this is the line I am struggling with:
if let session = session where…

Charlie
- 1,279
- 2
- 12
- 28
2
votes
0 answers
Failure and data loss using transferUserInfo method on watchOS 2
When Apple Watch and iPhone are not in range, I am sending 5-10 data dictionaries through transferUserInfo and observed that all dictionaries got delivered successfully when the devices come in range within 10 minutes. However, if I bring the Apple…

cfc16
- 61
- 4
1
vote
1 answer
How to make WCSession reachable when the watchOS app is running in background with HKWorkoutSession
My watchOS app uses workout API in order to stay running while the app goes to background. The issue is that WCSession becomes unreachable when the app is in background. However, I'm able to run my code and on some condition, it needs to send a…

Roman Samoilenko
- 932
- 12
- 25
1
vote
2 answers
How do I transfer a dictionary with transferUserInfo to Apple Watch?
I am trying to put a part of my Apple Watch app behind a paywall. For that, the iOS app automatically creates a dictionary with a true/false value, whether the content is purchases of not. The problem is, is no matter how I try, I cannot pass it to…

mt0000
- 57
- 5