Questions tagged [wcsession]

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.

120 questions
1
vote
0 answers

How do I pass In-App Purchase data to Watch?

I have part of my Apple Watch app behind a paywall, but I am unable to extract information from the WCSession transferUserInfo session. Also, how do I store that data on the Watch app as no NSUserDefaults are available on the Watch? Here is my code,…
mt0000
  • 57
  • 5
1
vote
0 answers

How do I detect in Watchkit when iPhone disconnects

I have a simple app that mirrors some information on a watch that also plays audio based on the information, I know how to detect when the watch disconnects from the phone using: if (WCSession.default.isReachable) { do something } but I cannot find…
Andy
  • 107
  • 1
  • 8
1
vote
2 answers

WCSession activate session not calling delegate method

I have this code written in my Manager class init method. if([WCSession isSupported]) { WCSession *session = [WCSession defaultSession]; session.delegate = self; [session activateSession]; } Also, implemented these delegate methods in…
Gaurav Parvadiya
  • 149
  • 2
  • 11
1
vote
0 answers

WCSession to check if companion app can receive message

Im using WCSession to communicate between apple Watch and iOS App. on both sides im initiating the session with: init() { self.session = WCSession.default self.session.delegate = self self.session.activate() } also implemented the method…
orthehelper
  • 4,009
  • 10
  • 40
  • 67
1
vote
1 answer

Why doesn't print() work when sending a message via Apple Watch To iPhone?

I am learning how to create a companion Watch App for an iPhone app. (Everything is being done on the simulator) I am sending a message when I tap a button on the Watch app. session.sendMessage(["Message": "It Worked" ], replyHandler: nil) {…
Ian Kohlert
  • 484
  • 1
  • 4
  • 15
1
vote
0 answers

didReceiveMessage receives and responds to message but method not called

Watch app interface controller : @IBAction func scheduleMeeting(_ sender: WKInterfaceButton) { if (WCSession.isSupported()) { session.sendMessage([ "scheduleMeeting": ["scheduleMeeting"] ], replyHandler: { (responses) -> Void in …
owen gerig
  • 6,165
  • 6
  • 52
  • 91
1
vote
1 answer

WCSession: Best way of using transferUserInfo or sendMessage?

I'm currently sending a list of users in form of an array of dictionaries using transferUserInfo(). I come to think that I really don't make use of the FIFO behavior that the UserInfo transfer provides to me. So I come to think if I could send my…
Tentacool7
  • 33
  • 4
1
vote
0 answers

watchOS 4.0 app [[WCSession defaultSession] isReachable] is always get status: connected

I am working on a project is related to Watch/iPhone and my phone pair with watch. my watch application working well then my mobile device wifi and bluetooth connection 'ON' getting status connected. I am doing wifi and bluetooth connection 'OFF' on…
BuLB JoBs
  • 841
  • 4
  • 20
1
vote
1 answer

watchOS 3 Using WCSession in class shared between device and watch

My app depends on constant communication between the watch and the device. I want to use a singleton to manage all messaging and session states. I want to use inheritance to further customize this behavior separately on the watch and on the device.…
Evan Gould
  • 13
  • 3
1
vote
1 answer

WCSession sendMessageData not working in watchOS 3

I am trying to send image from iOS to watchOS and I am getting below error. sendMessageData getting error: Error Domain=WCErrorDomain Code=7014 "Payload could not be delivered." UserInfo={NSLocalizedDescription=Payload could not be…
Raj Joshi
  • 2,669
  • 2
  • 30
  • 37
1
vote
2 answers

How can we send a message from iphone to AppleWatch when AppleWatch in backgroundstate or sleepmode?

I am working on sample watch kit app (Apple Watch + iPhone). Here my app is syncing fine. And also I worked on WCSession using data transferring (iPhone to apple watch). It is working fine when both are in active state. But I couldn't transfer data…
narendrakumar b
  • 115
  • 1
  • 12
1
vote
1 answer

Can only load either the watch app or the Phone app in the Xcode simulators

Can't believe this is causing me so many problems. I have written a simple watch and phone app in the same project so I can start to learn about the connectivity between the two. This simple app just uses the dictionary method of data transfer so…
Ariadne
  • 21
  • 1
  • 3
1
vote
1 answer

WCSession: is it possible to cancel queued message?

Is there any way to cancel messages sent by the sendMessage(_:replyHandler:errorHandler:) method of WCSession? From the documentation: Messages are queued serially and delivered in the order in which you sent them.
kelin
  • 11,323
  • 6
  • 67
  • 104
1
vote
2 answers

WatchOS 2 - Transferring image sequences for animation

I'm having trouble converting my app from WatchOS 1 to WatchOS2. I'm programmatically creating a sequence of images on the iPhone for the Watch to play. I'm putting them in a zip file (using SSZipArchive) in iOS and using transferFile() to send it…
ScottyB
  • 2,167
  • 1
  • 30
  • 46
1
vote
0 answers

WatchOS is not getting callback in didReceiveUserInfo from iPhone to Watch

Let me clear first that, everything was working perfectly. But from last two days I am facing very weird scenario, I am able to sendUserInfo from WatchOS to iOS but reverse is not happening. Even I am not getting any error anywhere. I tried to…
Mrug
  • 4,963
  • 2
  • 31
  • 53