Watch Connectivity

RSS for tag

Implement two-way communication between an iOS app and its paired watchOS app using Watch Connectivity.

Posts under Watch Connectivity tag

195 Posts

Post

Replies

Boosts

Views

Activity

Apple Watch App - Invalid Swift entry point data
For iOS 14 and watchOS 7.0, I completely recoded and modernized my app using Swift (was Objective C). I am almost done and am most proud of the job, but I have this issue that I need to fix on the Apple Watch app. I am not able to transfer data to the Apple Watch from the iPhone and get the following console messages. (The [xxx:xxxxxx] are my modification of the console messages.). I am guessing that the first 2 messages are the thing I need to fix and I need to fix this issue before I submit the app. 2020-09-24 08:29:02.873423-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data 2020-09-24 08:29:02.874413-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined. 2020-09-24 08:29:04.001368-0400 WatchApp Extension[xxx:xxxxxx] [WC] denying activation due to missing delegate ExtensionDelegate: your iphone is Reachable ExtensionDelegate: Session activated 2020-09-24 08:29:10.884500-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:15.046379-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047176-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047860-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.782075-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:24.390293-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:31:57.059417-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:00.055282-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated InterfaceController: your iphone is Reachable 2020-09-24 08:32:00.058230-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:08.427192-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:13.374677-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.375717-0400 WatchApp Extension[xxx:xxxxxx]] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.376426-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:51.861915-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated
20
0
8.2k
May ’22
WatchConnectivity framework - Companion app is not installed
I created a pair of fairly simple apps (iOS and watchOS) that send messages to each other. It uses the WatchConnectiivity framework. When I run the two apps in the Simulator, I can send messages from the phone to the watch, but I cannot send messages from the watch to the phone. When I attempt that I get the message "Companion app is not installed". I've seen suggestions that I need to uncheck the "Supports Running Without iOS App Installation" checkbox, but when I do that, the iOS app no longer runs in the Simulator. My code is here: https://github.com/mvolkmann/watch-with-ios. I'd love to get some hints about how to work past this.
4
0
1.1k
May ’22
WCSession detect watch powered off. HealthKit startWatchApp hangs
Install app on phone and watch Power the watch off Run the app on the phone. WCSession.default.isWatchAppInstalled == true WCSession.isSupported() == true WCSession.default.isPaired == true WCSession.default.activationState == .activated Now I try to run HKHealthStore startWatchApp. The startWatchApp method's completion never fires. I'd like to detect that the watch is powered off, so then I do not try to run the startWatchApp method. I can't see a way to detect that the watch is powered off. Alternatively - I'd like startWatchApp to quickly fail, or - to have some way of cancelling it if it doesn't return quickly. Any ideas please?
1
0
1.1k
May ’22
Transfer EventKit Data from iOS to watchOS
Hi there, I am trying to transfer EventKit Data like EKCalendars / EKEvents / EKReminder from iOS to watchOS via WatchConnectivity. The connection works but I cannot push these objects directly in response. I also cannot use NSKeyedArchiver since EKCalendars (example) are not able to get converted to Data. So, any Idea how I can transfer simple EventKit Data from iOS to watchOS? An addtional hint: I am already fetching these data within watchOS (so no solution) but if the device has an MDM profile it cannot fetch anything but the holiday calendar so I just wanted to test if the iPhone can fetch more (since the MDM profile is stored on iPhone, not on watch) but I can't transfer these data trough WatchConnectivity. Any hints would be nice – cannot be as hard as I think. Thanks!
0
0
747
Apr ’22
WatchOS 7.4 Beta : Simulator synced. UpdateApplicationContext() not working
Greetings fellow WatchOS app developers, On the iOS simulator running 12.5 beta, the method updateApplicationContext() claims that it succeeded, no exception is thrown and yet the WatchOS app, running on a WatchOS 7.4 simulator never gets its language session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) method invoked. Same issue in the other direction: The WatchOs app claims success on updating the iPhone app's application context. Yet nothing arrives. This works fine on real devices running iOS 14.5 beta and WatchOS 7.4 beta. Are there any workarounds? Due to Covid-19, I'm working remotely and can't debug on a real device, and need to be able to debug a critical WatchOS 7.4 specific issue. Thanks in advance!
8
0
3.3k
Apr ’22
WatchConnectivity File Transfer is received but can’t find file on watch
I am successfully transferring a .mov file and the correct delegate is being called from the watch counterpart. Yet when I try to reference the URL of the file that was transferred, the file is can’t be found. Is there a specific file path that transferred files are saved to? Is there another way I can download a .mov file from my iPhone device to a counterpart?
2
0
985
Apr ’22
isCompanionAppInstalled isn't updating
Hi, I am building a companion watch os app and I want to check before sending a message from watch to phone, whether the app is installed on phone. But whenever I check for whether the companion app is installed it always returns true, even when I uninstall the mobile application (Please note this is a dependant app). Next I found out that in independant apps, watchconnectivity supports isCompanionAppInstalled, and then I ticked the extension to run as independant and then used the isCompanionAppInstalled. It always returns false regardless of whether the app is installed or not? I am not sure why this not working for either of the above 2 scenarios? How can we find whether the companion IOS app is installed in the device from the watch?
1
0
1.6k
Apr ’22
WatchConnectivity not working on device
I have implemented a very simple iOS + WatchOS app project, where I test how one can communicate with the other. I will paste the code below, but the idea is really simple. Each app has one single screen with a button and a label. Tapping the button will send a message to the counterpart indicating the timestamp when the message was generated. If I run the app on the simulators, everything works fine: messages are sent and received correctly on both the iPhone and the Watch. (You can find a reference gif on imgur.com/ + o1ZQTLp). The problem occurs when I try to run the same apps on my physical devices. Session is activated successfully but messages aren't sent. If I debug the code, I even see the WCSession.isReachable value set to true. When debugging the WatchKit app, I see errorHandler is called on the func sendMessage(), and the error states: WatchConnectivity session on paired device is not reachable. However, the errorHandler isn't called from the iPhone app. Details of my devices: iOS version: 14.0.1 WatchOS version: 7.0.1 I tested this same code before installing the 7.0.1 WatchOS and it worked without any problems, so I wonder if the update introduced some error on the WatchConnectivity framework. Code on the iPhone app: import UIKit import WatchConnectivity class ViewController: UIViewController { 		@IBOutlet weak var messageLabel: UILabel! 		fileprivate var wcSession: WCSession! 		override func viewDidLoad() { 				super.viewDidLoad() 				wcSession = WCSession.default 				wcSession.delegate = self 				wcSession.activate() 		} 		@IBAction func sendMessageAction(_ sender: Any) { 				let message = [ 						"content": "Message sent from iPhone on \(Date())." 				] 				wcSession.sendMessage(message, replyHandler: nil, errorHandler: { error in 						print("Error when sending message: \(error.localizedDescription)") 				}) 		} } extension ViewController: WCSessionDelegate { 		func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { 				switch activationState { 				case .activated: 						print("WCSession activated successfully") 				case .inactive: 						print("Unable to activate the WCSession. Error: \(error?.localizedDescription ?? "--")") 				case .notActivated: 						print("Unexpected .notActivated state received after trying to activate the WCSession") 				@unknown default: 						print("Unexpected state received after trying to activate the WCSession") 				} 		} 		func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { 				guard let content = message["content"] as? String else { return } 				DispatchQueue.main.async { 						self.messageLabel.text = content 				} 		} 		func sessionDidBecomeInactive(_ session: WCSession) { 		} 		func sessionDidDeactivate(_ session: WCSession) { 		} } Code on the Watch Kit app: import WatchKit import Foundation import WatchConnectivity class InterfaceController: WKInterfaceController { 		@IBOutlet weak var messageLabel: WKInterfaceLabel! 		fileprivate var wcSession: WCSession! 		override func awake(withContext context: Any?) { 				wcSession = WCSession.default 				wcSession.delegate = self 				wcSession.activate() 		} 		@IBAction func sendMessageAction() { 				let message = [ 						"content": "Message sent from Watch on \(Date())." 				] 				wcSession.sendMessage(message, replyHandler: nil, errorHandler: { error in 						print("Error when sending message: \(error.localizedDescription)") 				}) 		} } extension InterfaceController: WCSessionDelegate { 		func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { 				switch activationState { 				case .activated: 						print("WCSession activated successfully") 				case .inactive: 						print("Unable to activate the WCSession. Error: \(error?.localizedDescription ?? "--")") 				case .notActivated: 						print("Unexpected .notActivated state received after trying to activate the WCSession") 				@unknown default: 						print("Unexpected state received after trying to activate the WCSession") 				} 		} 		func session(_ session: WCSession, didReceiveMessage message: [String: Any]) { 				guard let content = message["content"] as? String else { return } 				messageLabel.setText(content) 		} }
17
0
13k
Mar ’22
WCSession counterpart app not installed
Basically i had an existing project developed using swift 5. I integrated watch app, and developed it using swift UI. Now i have followed all the required steps , even followed apple documentation, but i am getting connectivity issues between my watch app and ios app.I have created the session successfully , when i send a message form watch app to ios app, it send successfully , but when i send a message from ios app to watch app, i get the error "WCSession counterpart app not installed". I have verified and cross checked all the below items bundle identifiers are correctly placed Supports running without IOS App installation is also unchecked. Session is activated successfully I am activating the session in App delegate in applicationDidFinishLaunchingWithOptions on IOS App and in onAppear function of my watch app main class I have even tried creating a new project with the same configurations like my main project, i created a dummy app using swift and added a Swift UI watch extension just like i did in my main project. The catch is i am not facing any connectivity issue in this dummy app, watch and ios app are communicating perfectly, i can receive the message successfully on both the devices using the same lines of code which i use ion my main project. I would really appreciate if someone can help me in this, i have tried almost all the solutions and wasted almost a month on this issue. I have attached my WCSession Manager code WCSession Manager Here are the snippets of my code App Delegate WatchSessionManager.sharedManager.startSession() Watch App import SwiftUI @main struct AmbitBoxApp: App {     @SceneBuilder var body: some Scene {         WindowGroup {             NavigationView {                 HomeView()             }             .onAppear {                 WatchSessionManager.sharedManager.startSession()             }         }         WKNotificationScene(controller: NotificationController.self, category: "myCategory")     } }
1
0
3.8k
Mar ’22
WCSession isComplicationEnabled() always false w simulator?
In my iOS app, I check to see if there's an active complication before sending complication data to the watch, given the limit of 50 transfers per day. It seems isComplicationEnabled() always returns false in the simulator, even though I have a watch app in a watchOS simulator that's active and running, with complications that actively get updated from the watch code as well. Data is successfully being passed from the simulated iPhone to the simulated watch app - both are active, connected and otherwise in sync. When I run using a physical device, WCSession isComplicationEnabled() on my iPhone does return true, but it seems to always be false in the simulator. Is this a limitation? Bug? Anyone else seeing this?
3
1
2.1k
Mar ’22
Help with first watch app
I’m new to IOS development, and have spent the last month learning the development environment and the framework. I was able to successfully create a phone app with Xcode 13 that communicates with an autopilot I designed and built for my boat. It communicates with a BLE peripheral designed into the autopilot. All well, and good. The phone app includes a map and and allows for placing custom annotations on the map marking the location of fish I catch, or shallow spots on the lake. I decided it would be handy to have a watch app that would contain a few controls such as Lock onto the current heading, and turn left and right 10 degrees. Those functions are already implemented on the phone app, so I though it would be a simple task to send a message to the phone to activate those functions. For the life of me I can’t figure out how to send messages between the two apps. I backed up and created a simple phone app with a companion watch app. Same problem, no clue how to make them talk. I’ve searched online, but all the tutorials are way more complicated than what I need, and I can’t ferret the functionality I’m looking for from any of them. Can someone point me in the right direction to get started? Or if it’s not too involved, explain how to setup the link between the two apps.
6
0
2.1k
Mar ’22
How receive data background if app not Running?
How receive data background if app not Running? Hell, I need recive data from iPhone to my app in Apple Watch background if apple Watch app not running. in extension Delegate I use these func  session(_ session: WCSession, didReceiveMessage message: [String : Any]) and session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) if app on Apple Watch data not received.
1
0
1.7k
Feb ’22
Independent Apple Watch app trying to access WIFI without iPhone
I developed an independent Apple Watch that can access network resources on its own using NSURLSession without going through the iPhone. This works fine if the iPhone is on, but if I turn the iPhone off it is not able to connect. Why does my app lose network connectivity when the iPhone is off even though it's a standalone app and the Watch is connected to my WIFI? Is there anything special I need to do to get this working? It appears that no apps work with the internet when the iPhone is off. WIFI is enabled and connected to my WIFI network under the Settings on the watch
0
0
1k
Feb ’22
WatchConnectivity 'didReceiveMessage' failing to .async
I am using WatchConnectivity to send messages between my swift iPhone / watch app. When I receive a message on the iPhone, from the watch, I need to jump to the main thread. The problem is; when the iPhone is in an inactive/not running state it never seems to complete that action. The iPhone receives the message, but when it tries to dispatchQueue.main.async{} , it seems to time out. The code inside .async{} never gets called. Here’s the code where it receives the message on the iPhone: func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { print("Message recieved: ", message) // We always make it to at least here, no matter what state the application is in. DispatchQueue.main.async { // This code is never called if the app is in an inactive/not running state. // Do something... } }
0
0
665
Feb ’22
How to communicate from Apple Watch Intent extension with the Phone?
I have a watch app which communicates with the iPhone app fine. But when running the WCSession from the Intent extension (used for Siri) I'm getting following in the console logs: Error Domain=WCErrorDomain Code=7018 "Companion app is not installed." Can the Watch Intent extension communicate with iPhone app - if so how can I enable it?
0
1
621
Jan ’22
Where to begin? Help with the following musician app idea for personal use:
Hey there, I am new to Swift, Objective C, however have a reasonable amount of experience in other programming languages. Want to get some thoughts on where to begin for an app idea I have. I want to build a WatchOS app that vibrates to a metronome. However, the catch is, I need it to be synchronised to a Digital Audio Workstation (Ableton Live) running on a Macbook. A bit of background on the use-case. I play in a band, and we run backing tracks on a MacBook. In order for the band to play in time to the backing tracks, we are all fed metronome clicks in our ears. I want to be able to feel the metronome on my apple watch instead. I was thinking about hooking into the IAC driver. In my DAW software, sending midi notes (that's the metronome) to an IAC driver channel, and feeding that through to the Apple Watch to vibrate each time a midi note is detected. Obviously, this would need to have as little latency as possible because we all need to play in sync. Some of us may still be on in-ears, so audible metronome clicks and the watch vibrations need to be completely in sync. Anyway, I am confident in going off and researching and developing the many individual components of this build, but I just need some guidance about my solution design and whether something like this is even possible. Many thanks!
3
0
1.5k
Jan ’22
The ios side cannot accept the data sent by the watchOS side
The ios side cannot accept the data sent by the watchOS side // watch os InterfaceController import WatchKit import Foundation import WatchConnectivity class InterfaceController: WKInterfaceController, WCSessionDelegate {       func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {   }       @IBOutlet var label: WKInterfaceLabel!   @IBOutlet var button: WKInterfaceButton!   override func awake(withContext context: Any?) {     // Configure interface objects here.     super.awake(withContext: context)               if(WCSession.isSupported()){      let session = WCSession.default;      session.delegate = self;      session.activate();     }           label.setText("") //    button.setTitle("Send Data")   }       @IBAction func sendData() {     print("send data")     let session = WCSession.default;     if(session.isReachable){      DispatchQueue.main.async {         print("Sending data from watch...")        session.transferUserInfo(["method": "sendDataToFlutter"])       }     }else{       print("App not reachable...")     }   }       override func willActivate() {     // This method is called when watch view controller is about to be visible to user     super.willActivate()   }       override func didDeactivate() {     // This method is called when watch view controller is no longer visible     super.didDeactivate()   }       func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {     self.label.setText(message["message"] as! String)   } } // AppDelegate.h #import <Flutter/Flutter.h> #import <UIKit/UIKit.h> #import <WatchConnectivity/WatchConnectivity.h> @interface WTUserInfoHandler : NSObject <FlutterStreamHandler> @end @interface AppDelegate : FlutterAppDelegate<WCSessionDelegate> @end // AppDelegate.m #include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #import "Runner-Swift.h" @implementation WTUserInfoHandler FlutterEventSink sink; NSDictionary *info; - (void) updateUserInfo:(nonnull NSDictionary<NSString *, id> *)userInfo{   NSLog(@"Update Recieved");   if(info != userInfo){     info = userInfo;     if(sink!=nil){       sink(@[userInfo]);     }   } } - (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {   NSLog(@"Adding Flutter Listener");   sink = eventSink;   return nil; } - (FlutterError*)onCancelWithArguments:(id)arguments {   NSLog(@"Removing Flutter Listener");   if(sink!=nil){     sink = nil;   }   return nil; } @end @interface AppDelegate () @property(nonatomic, strong)WCSession *session; @property(nonatomic, strong)WTUserInfoHandler* userInfoStreamHandler; @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {   if (@available(iOS 10.0, *)) {    [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;   }  [GeneratedPluginRegistrant registerWithRegistry:self];   [self initFlutterMethodChannelWatchSession];  // Override point for customization after application launch.  return [super application:application didFinishLaunchingWithOptions:launchOptions]; } # pragma mark -----------------WCSessionDelegate start------------------------ -(void) initFlutterMethodChannelWatchSession {   FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;   FlutterMethodChannel *tipinfoChannel = [FlutterMethodChannel                       methodChannelWithName:@"com.upcwangying.apps.flutter.boilerplate"                       binaryMessenger: controller];   [tipinfoChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {     // activate Session     if([@"initWatchSession" isEqualToString:call.method]){       [self activateSession];       result(@"WatchTips Activated");     }else if([@"sendDataToWatch" isEqualToString:call.method]){       [self sendDataToWatch: call.arguments];     } else {       result(FlutterMethodNotImplemented);;     }   }]; } - (void)sendDataToWatch:(NSString *) data {   if (self.session != nil) {     if (self.session.isPaired && self.session.isReachable) {       dispatch_async(dispatch_get_main_queue(), ^{         [self.session sendMessage:@{@"message": data} replyHandler: nil errorHandler: nil];       });     }   } } - (void)session:(WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(nullable NSError *)error { } /** ------------------------- iOS App State For Watch ------------------------ */ /** Called when the session can no longer be used to modify or add any new transfers and, all interactive messages will be cancelled, but delegate callbacks for background transfers can still occur. This will happen when the selected watch is being changed. */ - (void)sessionDidBecomeInactive:(WCSession *)session { } /** Called when all delegate callbacks for the previously selected watch has occurred. The session can be re-activated for the now selected watch using activateSession. */ - (void)sessionDidDeactivate:(WCSession *)session {} // Event triggered when userInfo Rxd - (void)session:(nonnull WCSession *)session didReceiveUserInfo:(nonnull NSDictionary<NSString *, id> *)userInfo {   if(self.userInfoStreamHandler != nil){     [self.userInfoStreamHandler updateUserInfo:userInfo];   } } // Method used to enable the Watch session - (void)activateSession {   [self activateChannel];   [self watchSession]; } // create our eventChannel -(FlutterEventChannel *) activateChannel {   self.userInfoStreamHandler = [[WTUserInfoHandler alloc] init];   FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;   FlutterEventChannel *eventChannel = [FlutterEventChannel eventChannelWithName:@"com.upcwangying.apps.flutter.boilerplate/watchdata" binaryMessenger:controller];   [eventChannel setStreamHandler:(NSObject<FlutterStreamHandler> * _Nullable) self.userInfoStreamHandler ];   return eventChannel; } // activate session - (WCSession *)watchSession {   if (self.session == nil) {     if ([WCSession isSupported]) {       self.session = [WCSession defaultSession];       [self.session setDelegate:self];       [self.session activateSession];     } else {       NSLog(@"Error - Watch Connectivity NOT supported");     }   }   return self.session; } - (void)dealloc {   if (self.session != nil) {     [self.session setDelegate:nil];   } } # pragma mark -----------------WCSessionDelegate end------------------------ @end
0
0
1.2k
Jan ’22
can someone explain this Apple tutorial step?
I'm new to Apple watch mainly because I am trying to develop a companion app. New as a user and a developer for Apple Watch. I'm following an official Apple tutorial, but it seems to make a lot of assumptions. App groups Complications (horrible choice of terminology?) In the "Update Current Complications from iOS apps" step, I have no idea how to do what it's saying. https://developer.apple.com/documentation/watchconnectivity/using_watch_connectivity_to_communicate_between_your_apple_watch_app_and_iphone_app How do I choose a "Modular" watch face? What constitutes a "Modular" watch face? I deep pressed the current (default) face and it went into an edit mode, but swiping right didn't do anything. Swiping left offered more options, but I don't think it aligns with what it's saying to do. Stuck at 1 & 2 Stuck at 1 & 2
3
0
933
Jan ’22
Apple Watch App - Invalid Swift entry point data
For iOS 14 and watchOS 7.0, I completely recoded and modernized my app using Swift (was Objective C). I am almost done and am most proud of the job, but I have this issue that I need to fix on the Apple Watch app. I am not able to transfer data to the Apple Watch from the iPhone and get the following console messages. (The [xxx:xxxxxx] are my modification of the console messages.). I am guessing that the first 2 messages are the thing I need to fix and I need to fix this issue before I submit the app. 2020-09-24 08:29:02.873423-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data 2020-09-24 08:29:02.874413-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined. 2020-09-24 08:29:04.001368-0400 WatchApp Extension[xxx:xxxxxx] [WC] denying activation due to missing delegate ExtensionDelegate: your iphone is Reachable ExtensionDelegate: Session activated 2020-09-24 08:29:10.884500-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:15.046379-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047176-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.047860-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:29:15.782075-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:29:24.390293-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:31:57.059417-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:00.055282-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated InterfaceController: your iphone is Reachable 2020-09-24 08:32:00.058230-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:08.427192-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated 2020-09-24 08:32:13.374677-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.375717-0400 WatchApp Extension[xxx:xxxxxx]] [WC] WCSession is missing its delegate 2020-09-24 08:32:13.376426-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate 2020-09-24 08:32:51.861915-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated
Replies
20
Boosts
0
Views
8.2k
Activity
May ’22
WatchConnectivity framework - Companion app is not installed
I created a pair of fairly simple apps (iOS and watchOS) that send messages to each other. It uses the WatchConnectiivity framework. When I run the two apps in the Simulator, I can send messages from the phone to the watch, but I cannot send messages from the watch to the phone. When I attempt that I get the message "Companion app is not installed". I've seen suggestions that I need to uncheck the "Supports Running Without iOS App Installation" checkbox, but when I do that, the iOS app no longer runs in the Simulator. My code is here: https://github.com/mvolkmann/watch-with-ios. I'd love to get some hints about how to work past this.
Replies
4
Boosts
0
Views
1.1k
Activity
May ’22
WCSession detect watch powered off. HealthKit startWatchApp hangs
Install app on phone and watch Power the watch off Run the app on the phone. WCSession.default.isWatchAppInstalled == true WCSession.isSupported() == true WCSession.default.isPaired == true WCSession.default.activationState == .activated Now I try to run HKHealthStore startWatchApp. The startWatchApp method's completion never fires. I'd like to detect that the watch is powered off, so then I do not try to run the startWatchApp method. I can't see a way to detect that the watch is powered off. Alternatively - I'd like startWatchApp to quickly fail, or - to have some way of cancelling it if it doesn't return quickly. Any ideas please?
Replies
1
Boosts
0
Views
1.1k
Activity
May ’22
Transfer EventKit Data from iOS to watchOS
Hi there, I am trying to transfer EventKit Data like EKCalendars / EKEvents / EKReminder from iOS to watchOS via WatchConnectivity. The connection works but I cannot push these objects directly in response. I also cannot use NSKeyedArchiver since EKCalendars (example) are not able to get converted to Data. So, any Idea how I can transfer simple EventKit Data from iOS to watchOS? An addtional hint: I am already fetching these data within watchOS (so no solution) but if the device has an MDM profile it cannot fetch anything but the holiday calendar so I just wanted to test if the iPhone can fetch more (since the MDM profile is stored on iPhone, not on watch) but I can't transfer these data trough WatchConnectivity. Any hints would be nice – cannot be as hard as I think. Thanks!
Replies
0
Boosts
0
Views
747
Activity
Apr ’22
WatchOS 7.4 Beta : Simulator synced. UpdateApplicationContext() not working
Greetings fellow WatchOS app developers, On the iOS simulator running 12.5 beta, the method updateApplicationContext() claims that it succeeded, no exception is thrown and yet the WatchOS app, running on a WatchOS 7.4 simulator never gets its language session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) method invoked. Same issue in the other direction: The WatchOs app claims success on updating the iPhone app's application context. Yet nothing arrives. This works fine on real devices running iOS 14.5 beta and WatchOS 7.4 beta. Are there any workarounds? Due to Covid-19, I'm working remotely and can't debug on a real device, and need to be able to debug a critical WatchOS 7.4 specific issue. Thanks in advance!
Replies
8
Boosts
0
Views
3.3k
Activity
Apr ’22
WatchConnectivity File Transfer is received but can’t find file on watch
I am successfully transferring a .mov file and the correct delegate is being called from the watch counterpart. Yet when I try to reference the URL of the file that was transferred, the file is can’t be found. Is there a specific file path that transferred files are saved to? Is there another way I can download a .mov file from my iPhone device to a counterpart?
Replies
2
Boosts
0
Views
985
Activity
Apr ’22
isCompanionAppInstalled isn't updating
Hi, I am building a companion watch os app and I want to check before sending a message from watch to phone, whether the app is installed on phone. But whenever I check for whether the companion app is installed it always returns true, even when I uninstall the mobile application (Please note this is a dependant app). Next I found out that in independant apps, watchconnectivity supports isCompanionAppInstalled, and then I ticked the extension to run as independant and then used the isCompanionAppInstalled. It always returns false regardless of whether the app is installed or not? I am not sure why this not working for either of the above 2 scenarios? How can we find whether the companion IOS app is installed in the device from the watch?
Replies
1
Boosts
0
Views
1.6k
Activity
Apr ’22
WatchConnectivity not working on device
I have implemented a very simple iOS + WatchOS app project, where I test how one can communicate with the other. I will paste the code below, but the idea is really simple. Each app has one single screen with a button and a label. Tapping the button will send a message to the counterpart indicating the timestamp when the message was generated. If I run the app on the simulators, everything works fine: messages are sent and received correctly on both the iPhone and the Watch. (You can find a reference gif on imgur.com/ + o1ZQTLp). The problem occurs when I try to run the same apps on my physical devices. Session is activated successfully but messages aren't sent. If I debug the code, I even see the WCSession.isReachable value set to true. When debugging the WatchKit app, I see errorHandler is called on the func sendMessage(), and the error states: WatchConnectivity session on paired device is not reachable. However, the errorHandler isn't called from the iPhone app. Details of my devices: iOS version: 14.0.1 WatchOS version: 7.0.1 I tested this same code before installing the 7.0.1 WatchOS and it worked without any problems, so I wonder if the update introduced some error on the WatchConnectivity framework. Code on the iPhone app: import UIKit import WatchConnectivity class ViewController: UIViewController { &#9;&#9;@IBOutlet weak var messageLabel: UILabel! &#9;&#9;fileprivate var wcSession: WCSession! &#9;&#9;override func viewDidLoad() { &#9;&#9;&#9;&#9;super.viewDidLoad() &#9;&#9;&#9;&#9;wcSession = WCSession.default &#9;&#9;&#9;&#9;wcSession.delegate = self &#9;&#9;&#9;&#9;wcSession.activate() &#9;&#9;} &#9;&#9;@IBAction func sendMessageAction(_ sender: Any) { &#9;&#9;&#9;&#9;let message = [ &#9;&#9;&#9;&#9;&#9;&#9;"content": "Message sent from iPhone on \(Date())." &#9;&#9;&#9;&#9;] &#9;&#9;&#9;&#9;wcSession.sendMessage(message, replyHandler: nil, errorHandler: { error in &#9;&#9;&#9;&#9;&#9;&#9;print("Error when sending message: \(error.localizedDescription)") &#9;&#9;&#9;&#9;}) &#9;&#9;} } extension ViewController: WCSessionDelegate { &#9;&#9;func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { &#9;&#9;&#9;&#9;switch activationState { &#9;&#9;&#9;&#9;case .activated: &#9;&#9;&#9;&#9;&#9;&#9;print("WCSession activated successfully") &#9;&#9;&#9;&#9;case .inactive: &#9;&#9;&#9;&#9;&#9;&#9;print("Unable to activate the WCSession. Error: \(error?.localizedDescription ?? "--")") &#9;&#9;&#9;&#9;case .notActivated: &#9;&#9;&#9;&#9;&#9;&#9;print("Unexpected .notActivated state received after trying to activate the WCSession") &#9;&#9;&#9;&#9;@unknown default: &#9;&#9;&#9;&#9;&#9;&#9;print("Unexpected state received after trying to activate the WCSession") &#9;&#9;&#9;&#9;} &#9;&#9;} &#9;&#9;func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { &#9;&#9;&#9;&#9;guard let content = message["content"] as? String else { return } &#9;&#9;&#9;&#9;DispatchQueue.main.async { &#9;&#9;&#9;&#9;&#9;&#9;self.messageLabel.text = content &#9;&#9;&#9;&#9;} &#9;&#9;} &#9;&#9;func sessionDidBecomeInactive(_ session: WCSession) { &#9;&#9;} &#9;&#9;func sessionDidDeactivate(_ session: WCSession) { &#9;&#9;} } Code on the Watch Kit app: import WatchKit import Foundation import WatchConnectivity class InterfaceController: WKInterfaceController { &#9;&#9;@IBOutlet weak var messageLabel: WKInterfaceLabel! &#9;&#9;fileprivate var wcSession: WCSession! &#9;&#9;override func awake(withContext context: Any?) { &#9;&#9;&#9;&#9;wcSession = WCSession.default &#9;&#9;&#9;&#9;wcSession.delegate = self &#9;&#9;&#9;&#9;wcSession.activate() &#9;&#9;} &#9;&#9;@IBAction func sendMessageAction() { &#9;&#9;&#9;&#9;let message = [ &#9;&#9;&#9;&#9;&#9;&#9;"content": "Message sent from Watch on \(Date())." &#9;&#9;&#9;&#9;] &#9;&#9;&#9;&#9;wcSession.sendMessage(message, replyHandler: nil, errorHandler: { error in &#9;&#9;&#9;&#9;&#9;&#9;print("Error when sending message: \(error.localizedDescription)") &#9;&#9;&#9;&#9;}) &#9;&#9;} } extension InterfaceController: WCSessionDelegate { &#9;&#9;func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { &#9;&#9;&#9;&#9;switch activationState { &#9;&#9;&#9;&#9;case .activated: &#9;&#9;&#9;&#9;&#9;&#9;print("WCSession activated successfully") &#9;&#9;&#9;&#9;case .inactive: &#9;&#9;&#9;&#9;&#9;&#9;print("Unable to activate the WCSession. Error: \(error?.localizedDescription ?? "--")") &#9;&#9;&#9;&#9;case .notActivated: &#9;&#9;&#9;&#9;&#9;&#9;print("Unexpected .notActivated state received after trying to activate the WCSession") &#9;&#9;&#9;&#9;@unknown default: &#9;&#9;&#9;&#9;&#9;&#9;print("Unexpected state received after trying to activate the WCSession") &#9;&#9;&#9;&#9;} &#9;&#9;} &#9;&#9;func session(_ session: WCSession, didReceiveMessage message: [String: Any]) { &#9;&#9;&#9;&#9;guard let content = message["content"] as? String else { return } &#9;&#9;&#9;&#9;messageLabel.setText(content) &#9;&#9;} }
Replies
17
Boosts
0
Views
13k
Activity
Mar ’22
WCSession counterpart app not installed
Basically i had an existing project developed using swift 5. I integrated watch app, and developed it using swift UI. Now i have followed all the required steps , even followed apple documentation, but i am getting connectivity issues between my watch app and ios app.I have created the session successfully , when i send a message form watch app to ios app, it send successfully , but when i send a message from ios app to watch app, i get the error "WCSession counterpart app not installed". I have verified and cross checked all the below items bundle identifiers are correctly placed Supports running without IOS App installation is also unchecked. Session is activated successfully I am activating the session in App delegate in applicationDidFinishLaunchingWithOptions on IOS App and in onAppear function of my watch app main class I have even tried creating a new project with the same configurations like my main project, i created a dummy app using swift and added a Swift UI watch extension just like i did in my main project. The catch is i am not facing any connectivity issue in this dummy app, watch and ios app are communicating perfectly, i can receive the message successfully on both the devices using the same lines of code which i use ion my main project. I would really appreciate if someone can help me in this, i have tried almost all the solutions and wasted almost a month on this issue. I have attached my WCSession Manager code WCSession Manager Here are the snippets of my code App Delegate WatchSessionManager.sharedManager.startSession() Watch App import SwiftUI @main struct AmbitBoxApp: App {     @SceneBuilder var body: some Scene {         WindowGroup {             NavigationView {                 HomeView()             }             .onAppear {                 WatchSessionManager.sharedManager.startSession()             }         }         WKNotificationScene(controller: NotificationController.self, category: "myCategory")     } }
Replies
1
Boosts
0
Views
3.8k
Activity
Mar ’22
WCSession isComplicationEnabled() always false w simulator?
In my iOS app, I check to see if there's an active complication before sending complication data to the watch, given the limit of 50 transfers per day. It seems isComplicationEnabled() always returns false in the simulator, even though I have a watch app in a watchOS simulator that's active and running, with complications that actively get updated from the watch code as well. Data is successfully being passed from the simulated iPhone to the simulated watch app - both are active, connected and otherwise in sync. When I run using a physical device, WCSession isComplicationEnabled() on my iPhone does return true, but it seems to always be false in the simulator. Is this a limitation? Bug? Anyone else seeing this?
Replies
3
Boosts
1
Views
2.1k
Activity
Mar ’22
Help with first watch app
I’m new to IOS development, and have spent the last month learning the development environment and the framework. I was able to successfully create a phone app with Xcode 13 that communicates with an autopilot I designed and built for my boat. It communicates with a BLE peripheral designed into the autopilot. All well, and good. The phone app includes a map and and allows for placing custom annotations on the map marking the location of fish I catch, or shallow spots on the lake. I decided it would be handy to have a watch app that would contain a few controls such as Lock onto the current heading, and turn left and right 10 degrees. Those functions are already implemented on the phone app, so I though it would be a simple task to send a message to the phone to activate those functions. For the life of me I can’t figure out how to send messages between the two apps. I backed up and created a simple phone app with a companion watch app. Same problem, no clue how to make them talk. I’ve searched online, but all the tutorials are way more complicated than what I need, and I can’t ferret the functionality I’m looking for from any of them. Can someone point me in the right direction to get started? Or if it’s not too involved, explain how to setup the link between the two apps.
Replies
6
Boosts
0
Views
2.1k
Activity
Mar ’22
phone send message to watch fail
I have a app want to add watch extension,use WatchConnectivity is success when watch and phone all active,but it is fail when watch inactive. how to do phone can send message success or trigger watch shock when watch inactive
Replies
0
Boosts
0
Views
714
Activity
Feb ’22
How receive data background if app not Running?
How receive data background if app not Running? Hell, I need recive data from iPhone to my app in Apple Watch background if apple Watch app not running. in extension Delegate I use these func  session(_ session: WCSession, didReceiveMessage message: [String : Any]) and session(_ session: WCSession, didReceiveMessageData messageData: Data, replyHandler: @escaping (Data) -> Void) if app on Apple Watch data not received.
Replies
1
Boosts
0
Views
1.7k
Activity
Feb ’22
Independent Apple Watch app trying to access WIFI without iPhone
I developed an independent Apple Watch that can access network resources on its own using NSURLSession without going through the iPhone. This works fine if the iPhone is on, but if I turn the iPhone off it is not able to connect. Why does my app lose network connectivity when the iPhone is off even though it's a standalone app and the Watch is connected to my WIFI? Is there anything special I need to do to get this working? It appears that no apps work with the internet when the iPhone is off. WIFI is enabled and connected to my WIFI network under the Settings on the watch
Replies
0
Boosts
0
Views
1k
Activity
Feb ’22
WatchConnectivity 'didReceiveMessage' failing to .async
I am using WatchConnectivity to send messages between my swift iPhone / watch app. When I receive a message on the iPhone, from the watch, I need to jump to the main thread. The problem is; when the iPhone is in an inactive/not running state it never seems to complete that action. The iPhone receives the message, but when it tries to dispatchQueue.main.async{} , it seems to time out. The code inside .async{} never gets called. Here’s the code where it receives the message on the iPhone: func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { print("Message recieved: ", message) // We always make it to at least here, no matter what state the application is in. DispatchQueue.main.async { // This code is never called if the app is in an inactive/not running state. // Do something... } }
Replies
0
Boosts
0
Views
665
Activity
Feb ’22
How to communicate from Apple Watch Intent extension with the Phone?
I have a watch app which communicates with the iPhone app fine. But when running the WCSession from the Intent extension (used for Siri) I'm getting following in the console logs: Error Domain=WCErrorDomain Code=7018 "Companion app is not installed." Can the Watch Intent extension communicate with iPhone app - if so how can I enable it?
Replies
0
Boosts
1
Views
621
Activity
Jan ’22
Where to begin? Help with the following musician app idea for personal use:
Hey there, I am new to Swift, Objective C, however have a reasonable amount of experience in other programming languages. Want to get some thoughts on where to begin for an app idea I have. I want to build a WatchOS app that vibrates to a metronome. However, the catch is, I need it to be synchronised to a Digital Audio Workstation (Ableton Live) running on a Macbook. A bit of background on the use-case. I play in a band, and we run backing tracks on a MacBook. In order for the band to play in time to the backing tracks, we are all fed metronome clicks in our ears. I want to be able to feel the metronome on my apple watch instead. I was thinking about hooking into the IAC driver. In my DAW software, sending midi notes (that's the metronome) to an IAC driver channel, and feeding that through to the Apple Watch to vibrate each time a midi note is detected. Obviously, this would need to have as little latency as possible because we all need to play in sync. Some of us may still be on in-ears, so audible metronome clicks and the watch vibrations need to be completely in sync. Anyway, I am confident in going off and researching and developing the many individual components of this build, but I just need some guidance about my solution design and whether something like this is even possible. Many thanks!
Replies
3
Boosts
0
Views
1.5k
Activity
Jan ’22
confirguration nécessaire pour utiliser apple watch se gps cellular
confirguration nécessaire pour utiliser apple watch se gps cellular: IOS 15 ou IOS 14 (jai 1 Iphone 6s plus et IOS 14.86) merci
Replies
0
Boosts
0
Views
466
Activity
Jan ’22
The ios side cannot accept the data sent by the watchOS side
The ios side cannot accept the data sent by the watchOS side // watch os InterfaceController import WatchKit import Foundation import WatchConnectivity class InterfaceController: WKInterfaceController, WCSessionDelegate {       func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {   }       @IBOutlet var label: WKInterfaceLabel!   @IBOutlet var button: WKInterfaceButton!   override func awake(withContext context: Any?) {     // Configure interface objects here.     super.awake(withContext: context)               if(WCSession.isSupported()){      let session = WCSession.default;      session.delegate = self;      session.activate();     }           label.setText("") //    button.setTitle("Send Data")   }       @IBAction func sendData() {     print("send data")     let session = WCSession.default;     if(session.isReachable){      DispatchQueue.main.async {         print("Sending data from watch...")        session.transferUserInfo(["method": "sendDataToFlutter"])       }     }else{       print("App not reachable...")     }   }       override func willActivate() {     // This method is called when watch view controller is about to be visible to user     super.willActivate()   }       override func didDeactivate() {     // This method is called when watch view controller is no longer visible     super.didDeactivate()   }       func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {     self.label.setText(message["message"] as! String)   } } // AppDelegate.h #import <Flutter/Flutter.h> #import <UIKit/UIKit.h> #import <WatchConnectivity/WatchConnectivity.h> @interface WTUserInfoHandler : NSObject <FlutterStreamHandler> @end @interface AppDelegate : FlutterAppDelegate<WCSessionDelegate> @end // AppDelegate.m #include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #import "Runner-Swift.h" @implementation WTUserInfoHandler FlutterEventSink sink; NSDictionary *info; - (void) updateUserInfo:(nonnull NSDictionary<NSString *, id> *)userInfo{   NSLog(@"Update Recieved");   if(info != userInfo){     info = userInfo;     if(sink!=nil){       sink(@[userInfo]);     }   } } - (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {   NSLog(@"Adding Flutter Listener");   sink = eventSink;   return nil; } - (FlutterError*)onCancelWithArguments:(id)arguments {   NSLog(@"Removing Flutter Listener");   if(sink!=nil){     sink = nil;   }   return nil; } @end @interface AppDelegate () @property(nonatomic, strong)WCSession *session; @property(nonatomic, strong)WTUserInfoHandler* userInfoStreamHandler; @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {   if (@available(iOS 10.0, *)) {    [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;   }  [GeneratedPluginRegistrant registerWithRegistry:self];   [self initFlutterMethodChannelWatchSession];  // Override point for customization after application launch.  return [super application:application didFinishLaunchingWithOptions:launchOptions]; } # pragma mark -----------------WCSessionDelegate start------------------------ -(void) initFlutterMethodChannelWatchSession {   FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;   FlutterMethodChannel *tipinfoChannel = [FlutterMethodChannel                       methodChannelWithName:@"com.upcwangying.apps.flutter.boilerplate"                       binaryMessenger: controller];   [tipinfoChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {     // activate Session     if([@"initWatchSession" isEqualToString:call.method]){       [self activateSession];       result(@"WatchTips Activated");     }else if([@"sendDataToWatch" isEqualToString:call.method]){       [self sendDataToWatch: call.arguments];     } else {       result(FlutterMethodNotImplemented);;     }   }]; } - (void)sendDataToWatch:(NSString *) data {   if (self.session != nil) {     if (self.session.isPaired && self.session.isReachable) {       dispatch_async(dispatch_get_main_queue(), ^{         [self.session sendMessage:@{@"message": data} replyHandler: nil errorHandler: nil];       });     }   } } - (void)session:(WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(nullable NSError *)error { } /** ------------------------- iOS App State For Watch ------------------------ */ /** Called when the session can no longer be used to modify or add any new transfers and, all interactive messages will be cancelled, but delegate callbacks for background transfers can still occur. This will happen when the selected watch is being changed. */ - (void)sessionDidBecomeInactive:(WCSession *)session { } /** Called when all delegate callbacks for the previously selected watch has occurred. The session can be re-activated for the now selected watch using activateSession. */ - (void)sessionDidDeactivate:(WCSession *)session {} // Event triggered when userInfo Rxd - (void)session:(nonnull WCSession *)session didReceiveUserInfo:(nonnull NSDictionary<NSString *, id> *)userInfo {   if(self.userInfoStreamHandler != nil){     [self.userInfoStreamHandler updateUserInfo:userInfo];   } } // Method used to enable the Watch session - (void)activateSession {   [self activateChannel];   [self watchSession]; } // create our eventChannel -(FlutterEventChannel *) activateChannel {   self.userInfoStreamHandler = [[WTUserInfoHandler alloc] init];   FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;   FlutterEventChannel *eventChannel = [FlutterEventChannel eventChannelWithName:@"com.upcwangying.apps.flutter.boilerplate/watchdata" binaryMessenger:controller];   [eventChannel setStreamHandler:(NSObject<FlutterStreamHandler> * _Nullable) self.userInfoStreamHandler ];   return eventChannel; } // activate session - (WCSession *)watchSession {   if (self.session == nil) {     if ([WCSession isSupported]) {       self.session = [WCSession defaultSession];       [self.session setDelegate:self];       [self.session activateSession];     } else {       NSLog(@"Error - Watch Connectivity NOT supported");     }   }   return self.session; } - (void)dealloc {   if (self.session != nil) {     [self.session setDelegate:nil];   } } # pragma mark -----------------WCSessionDelegate end------------------------ @end
Replies
0
Boosts
0
Views
1.2k
Activity
Jan ’22
can someone explain this Apple tutorial step?
I'm new to Apple watch mainly because I am trying to develop a companion app. New as a user and a developer for Apple Watch. I'm following an official Apple tutorial, but it seems to make a lot of assumptions. App groups Complications (horrible choice of terminology?) In the "Update Current Complications from iOS apps" step, I have no idea how to do what it's saying. https://developer.apple.com/documentation/watchconnectivity/using_watch_connectivity_to_communicate_between_your_apple_watch_app_and_iphone_app How do I choose a "Modular" watch face? What constitutes a "Modular" watch face? I deep pressed the current (default) face and it went into an edit mode, but swiping right didn't do anything. Swiping left offered more options, but I don't think it aligns with what it's saying to do. Stuck at 1 & 2 Stuck at 1 & 2
Replies
3
Boosts
0
Views
933
Activity
Jan ’22