Watch Complications

RSS for tag

Display timely and relevant information about your app on the Apple Watch face using Complications.

Posts under Watch Complications tag

170 Posts

Post

Replies

Boosts

Views

Activity

How to dynamically configure watch widget using phone app?
I'm excited to already have a widget/complication running on watchOS using WidgetKit. It's a great framework! Next, I need to get some settings from my iOS app over to the watch to help configure the widget. Ideally, I'd like the user to be able to change settings on the iOS app, and have them reflected in the watch widget pretty soon after without having to do anything on the watch. (From early testing, updateApplicationContext is decent because it can still be sent even when the watch app isn't active, but unfortunately it doesn't seem to wake up to process this incoming data until the user manually opens the app on the watch again. But maybe I've missed something.) Anyway, what's the best way to do this configuration between phone and watch?
0
1
797
Jun ’22
Have basic complications been deprecated in watchOS 9?
I have a simple complication-only app called Roughly, which shows the approximate time in words, to the nearest five minutes, in a choice of languages. It's been on the store for several years, and it's getting creaky. This new guide to WidgetKit is making me nervous: https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app There's a line buried in there: watchOS 9 and later no longer shows families like CLKComplicationFamily.circularSmall, CLKComplicationFamily.modularSmall, or CLKComplicationFamily.modularLarge on watch faces. So... is that the end of all basic complications that haven't been made into Widgets? If so, it would be good to have more clarity on this — I do feel it's easy to miss when things are deprecated. Thanks for any info!
2
0
1.9k
Jun ’22
Watch Series 7 Complication Icon Sizes
Is it possible to use PNGs for Watch Series 7 complication sizes? In the human interface guidelines here https://developer.apple.com/design/human-interface-guidelines/watchos/overview/complications/ it specifies a size for the new 41mm and 45mm devices. However, in the latest Xcode (13.2.1) I can't see any way to bring up a slot for you to drop in images at these sizes; all you can get is a slot for a vector image and some of the older device sizes. Also, it seems if you don't provide a vector your existing png complication's icons appear slightly cropped when used on a 45mm device. Is the only way to support Watch Series 7 complications to use a vector or is there some hidden way or tick box somewhere to get pngs to work?
1
0
1.6k
Apr ’22
Complication experiencing odd behaviour for only one user
I have one user that is getting some very odd behavior for one of my complications. The complication will work fine for a little bit, but then gets into a state where when the watch is asleep it is displaying correctly and then when the watch wakes up it's the default dashed out view with the app name. This is happening on a Watch Series 5 with cellular that is on the latest WatchOS (8.5). It was also happening on 8.4.2. All of the other complication types work perfectly fine on their watch. It is just this specific one, which other than the way the view is laid out is no different than the others under the hood. They all share the same data. The problem complication uses CLKComplicationTemplateGraphicRectangularFullView and the only thing I can think of is that maybe there is an issue with support on the Series 5. Though I have no evidence to support this theory since there isn't any helpful log messages. Testers on Series 6 and Series 7 report zero problems with this complication. I have added in a special view for when this complication fails for whatever reason, at least whatever reason I can capture and it is never displayed. It just shows the generic Apple dashed out view. So it seems something else is going wrong under the hood. Any and all help would be much appreciated.
1
0
1k
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
2k
Mar ’22
WKExtension.shared().rootInterfaceController returns nil
With the WatchOS 8 upgrade, it appears WKExtension.shared().rootInterfaceController is returning nil in certain situations. One situation I've identified is when there's a multi-page watch app. But, if I remove the segue, the WKExtension.shared().rootInterfaceController has a value. So, it seems that using paged navigation can cause the rootInterfaceController to be nil. Even if the dietaryDetailsController is made the Main Entry Point, rootInterfaceController has a value. So, it only seems to be a problem when it's the first page. Long term, SwiftUI can be implemented, but, a short term fix is necessary since the rootInterfaceController is necessary to refresh complication data. With a push segue, the rootInterfaceController does have a value. Anyone else experiencing this? Am I missing something in configuring the first page of multi-page navigation?
2
0
1.3k
Mar ’22
WatchKit Complications not syncing from iOS Watch app
I'm having an issue where the complications for my app aren't syncing to the watch if you add them from the Watch app on iOS. However if you add them from the watch itself they work on the watch, but don't show on the iOS Watch app. I'm using getLocalizableSampleTemplate(for:withHandler:) to generate the complication templates. I'm not including a complication bundle or static images since it appears that this is not needed anymore according to the docs. The templates show fine on both the watch and iOS Watch app, they just don't show up on the watch if added from the iOS Watch app and vice versa. If I add a new watch face and then add the complications to it and try to set it as the default watch face from the iOS app it will set it on the watch, but doesn't have any of the complications. If I load up the Console app and look at the iPhone system logs I can see it trying to send the watch face with the correct complication descriptors, but nothing happens on the watch itself. If I use a simulator it doesn't even sync any of the watch faces until I reboot the watch sim. One final note, the watch portion of the app has not been released in the App store before. This is a new addition to an already released app. Not sure if that could be part of the issue, but just thought I should include it. I'm at a loss here, any help would be appreciated.
3
0
1.2k
Mar ’22
Watch OS app installation error - Could not attach to pid : “11996”
We've added a watch app extension in the developed iOS application source code. When we're selecting and running the watch application target, We're getting this application installation error with an alert: Could not attach to pid : “11996” attach failed ((os/kern) invalid argument) This alert is coming only on M1 chip-based Mac systems. But the same code is running well on Intel-based Mac systems. Any help from anyone is highly appreciable. Thank you.
2
0
1.4k
Mar ’22
How to communicate with other apps in the standalone Apple Watch app
I haven't developed an Apple Watch app yet. I have an existing app for sale. Users of that app sometimes send me requests for functions using Apple Watch in the app by email. Considering future maintenance, I would like to sell the Apple Watch app as a paid app. However, I know that watch app support cannot be turned on/off by in-app purchases in existing apps. Is there any way for the standalone Apple Watch app to communicate with my existing paid/free apps?
1
0
744
Feb ’22
handle never invoked with WKURLSessionRefreshBackgroundTask type
Hi Folks, I am building a SwiftUI based WatchOS app primarily focused on updating a complication using data from a REST API call. I am trying to reproduce the approach to updating complications in the background as described in "Keeping your complications up to date". The trouble I have is that the func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) method on the ExtensionDelegate is never called for the WKURLSessionRefreshBackgroundTask task type. The handle method is invoked for other task types such as WKSnapshotRefreshBackgroundTask. After some refactoring, I have deviated from the approach in the video and I now reshedule the background task in the func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) method of the URLSessionDownloadDelegate. This works fine, and the tasks are being resheduled in the background, but my concern is that there maybe a WKURLSessionRefreshBackgroundTask object lurking in the background for which I haven't called setTaskCompletedWithSnapshot. My session is configured as follows: private lazy var backgroundURLSession: URLSession = { let appBundleName = Bundle.main.bundleURL.lastPathComponent.lowercased().replacingOccurrences(of: " ", with: ".") let sessionIdentifier = "com.gjam.liffeywatch.\(appBundleName)" let config = URLSessionConfiguration .background(withIdentifier: sessionIdentifier) config.isDiscretionary = false config.sessionSendsLaunchEvents = true config.requestCachePolicy = .reloadIgnoringLocalCacheData config.urlCache = nil return URLSession (configuration: config, delegate: self , delegateQueue: nil ) }() and the scheduling code is a follows: func schedule(_ first: Bool) { print("Scheduling background URL session") let bgTask = backgroundURLSession.downloadTask(with: LiffyDataProvider.url) #if DEBUG bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 10 : 60 * 2) #else bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 30 : 60 * 60 * 2) #endif bgTask.countOfBytesClientExpectsToSend = 200 bgTask.countOfBytesClientExpectsToReceive = 1024 bgTask.resume() print("Task started") backgroundTask = bgTask } Does anyone have any idea's why the handle method is not invoked with WKURLSessionRefreshBackgroundTask tasks? Cheers, Gareth.
2
0
1.2k
Jan ’22
SF Symbol using string interpolation
I was very happy when I saw this: "You can embed a symbol inside a run of text by using string interpolation." Text("Thalia… \(Image(systemName: "chevron.forward"))") Unfortunately this is a feature of SwiftUI and not generally available string interpolation. In places where a string is expected like an Apple Watch Compilcation Text Provider CLKSimpleTextProvider(text: "\(Image(systemName: "heart"))") this doesn't return an inline Image but "Image(provider: SwiftUI.ImageProviderBox<SwiftUI.Image.(unknown context at $18487da20).NamedImageProvider>)" So… Is there a way to include an SF Symbol in a regular string to wiggle it into a CLKSimpleTextProvider?
2
0
3k
Dec ’21
How to dynamically configure watch widget using phone app?
I'm excited to already have a widget/complication running on watchOS using WidgetKit. It's a great framework! Next, I need to get some settings from my iOS app over to the watch to help configure the widget. Ideally, I'd like the user to be able to change settings on the iOS app, and have them reflected in the watch widget pretty soon after without having to do anything on the watch. (From early testing, updateApplicationContext is decent because it can still be sent even when the watch app isn't active, but unfortunately it doesn't seem to wake up to process this incoming data until the user manually opens the app on the watch again. But maybe I've missed something.) Anyway, what's the best way to do this configuration between phone and watch?
Replies
0
Boosts
1
Views
797
Activity
Jun ’22
Have basic complications been deprecated in watchOS 9?
I have a simple complication-only app called Roughly, which shows the approximate time in words, to the nearest five minutes, in a choice of languages. It's been on the store for several years, and it's getting creaky. This new guide to WidgetKit is making me nervous: https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app There's a line buried in there: watchOS 9 and later no longer shows families like CLKComplicationFamily.circularSmall, CLKComplicationFamily.modularSmall, or CLKComplicationFamily.modularLarge on watch faces. So... is that the end of all basic complications that haven't been made into Widgets? If so, it would be good to have more clarity on this — I do feel it's easy to miss when things are deprecated. Thanks for any info!
Replies
2
Boosts
0
Views
1.9k
Activity
Jun ’22
WatchOS true always on, no dimming... always active
Hi, As the title says... Is there any API or code to keep the screen on the Apple Watch to truly remain ALWAYS on? with no dimming whatsoever... even when the watch screen is passed its wake duration... is it possible to keep the app in an always active state?
Replies
1
Boosts
1
Views
1.9k
Activity
Jun ’22
Prevent Workout complication animation
Hi there, I am wondering how to prevent animation of the Workout complication (the running guy on the main Apple Watch screen). Is there a way to prevent this in Swift when starting a Workout Session ? Best
Replies
0
Boosts
0
Views
477
Activity
Jun ’22
Watch Series 7 Complication Icon Sizes
Is it possible to use PNGs for Watch Series 7 complication sizes? In the human interface guidelines here https://developer.apple.com/design/human-interface-guidelines/watchos/overview/complications/ it specifies a size for the new 41mm and 45mm devices. However, in the latest Xcode (13.2.1) I can't see any way to bring up a slot for you to drop in images at these sizes; all you can get is a slot for a vector image and some of the older device sizes. Also, it seems if you don't provide a vector your existing png complication's icons appear slightly cropped when used on a 45mm device. Is the only way to support Watch Series 7 complications to use a vector or is there some hidden way or tick box somewhere to get pngs to work?
Replies
1
Boosts
0
Views
1.6k
Activity
Apr ’22
WCSession.isComplicationEnabled() always returns false on iOS 15.4/15.4.1
WCSession.isComplicationEnabled() always returns false on iOS 15.4/15.4.1.
Replies
0
Boosts
0
Views
798
Activity
Apr ’22
Home Screen bundle id
Hi, Currently I'm working on Apple Watch ui testing using XCTest and I need to interact with Apple Watch's Home screen in order to perform different actions with complications. As I know from my iOS experience, Home Screen can be by using bundle id "com.apple.springboard". I need something similar but for watchOS.
Replies
1
Boosts
0
Views
1.3k
Activity
Apr ’22
WatchOS Home Screen bundle id
Hi, Currently I'm working on Apple Watch ui testing using XCTest and I need to interact with Apple Watch's Home screen in order to perform different actions with complications. As I know from my iOS experience, Home Screen can be by using bundle id "com.apple.springboard". I need something similar but for watchOS.
Replies
1
Boosts
0
Views
921
Activity
Apr ’22
Apple Watch Home Screen Bundle id
Hi, guys I am writing UI tests for Apple Watch using XCTest and I need to interact with Apple Watch Home Screen and with elements on it. I know that "com.apple.springboard" could be used to interact with iPhone's Home Screen, what about Apple Watch? Thank you!
Replies
1
Boosts
0
Views
999
Activity
Mar ’22
Complication experiencing odd behaviour for only one user
I have one user that is getting some very odd behavior for one of my complications. The complication will work fine for a little bit, but then gets into a state where when the watch is asleep it is displaying correctly and then when the watch wakes up it's the default dashed out view with the app name. This is happening on a Watch Series 5 with cellular that is on the latest WatchOS (8.5). It was also happening on 8.4.2. All of the other complication types work perfectly fine on their watch. It is just this specific one, which other than the way the view is laid out is no different than the others under the hood. They all share the same data. The problem complication uses CLKComplicationTemplateGraphicRectangularFullView and the only thing I can think of is that maybe there is an issue with support on the Series 5. Though I have no evidence to support this theory since there isn't any helpful log messages. Testers on Series 6 and Series 7 report zero problems with this complication. I have added in a special view for when this complication fails for whatever reason, at least whatever reason I can capture and it is never displayed. It just shows the generic Apple dashed out view. So it seems something else is going wrong under the hood. Any and all help would be much appreciated.
Replies
1
Boosts
0
Views
1k
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
2k
Activity
Mar ’22
WKExtension.shared().rootInterfaceController returns nil
With the WatchOS 8 upgrade, it appears WKExtension.shared().rootInterfaceController is returning nil in certain situations. One situation I've identified is when there's a multi-page watch app. But, if I remove the segue, the WKExtension.shared().rootInterfaceController has a value. So, it seems that using paged navigation can cause the rootInterfaceController to be nil. Even if the dietaryDetailsController is made the Main Entry Point, rootInterfaceController has a value. So, it only seems to be a problem when it's the first page. Long term, SwiftUI can be implemented, but, a short term fix is necessary since the rootInterfaceController is necessary to refresh complication data. With a push segue, the rootInterfaceController does have a value. Anyone else experiencing this? Am I missing something in configuring the first page of multi-page navigation?
Replies
2
Boosts
0
Views
1.3k
Activity
Mar ’22
Series 3 Apple Watch won’t connect to my iPhone 13
I recently tried to connect my Apple Watch (series 3) to my iPhone (13). Before it connects it says I need to update it and I try to but it says that I need to connect to the internet even though I am and it won’t let me continue.
Replies
1
Boosts
0
Views
545
Activity
Mar ’22
WatchKit Complications not syncing from iOS Watch app
I'm having an issue where the complications for my app aren't syncing to the watch if you add them from the Watch app on iOS. However if you add them from the watch itself they work on the watch, but don't show on the iOS Watch app. I'm using getLocalizableSampleTemplate(for:withHandler:) to generate the complication templates. I'm not including a complication bundle or static images since it appears that this is not needed anymore according to the docs. The templates show fine on both the watch and iOS Watch app, they just don't show up on the watch if added from the iOS Watch app and vice versa. If I add a new watch face and then add the complications to it and try to set it as the default watch face from the iOS app it will set it on the watch, but doesn't have any of the complications. If I load up the Console app and look at the iPhone system logs I can see it trying to send the watch face with the correct complication descriptors, but nothing happens on the watch itself. If I use a simulator it doesn't even sync any of the watch faces until I reboot the watch sim. One final note, the watch portion of the app has not been released in the App store before. This is a new addition to an already released app. Not sure if that could be part of the issue, but just thought I should include it. I'm at a loss here, any help would be appreciated.
Replies
3
Boosts
0
Views
1.2k
Activity
Mar ’22
Watch OS app installation error - Could not attach to pid : “11996”
We've added a watch app extension in the developed iOS application source code. When we're selecting and running the watch application target, We're getting this application installation error with an alert: Could not attach to pid : “11996” attach failed ((os/kern) invalid argument) This alert is coming only on M1 chip-based Mac systems. But the same code is running well on Intel-based Mac systems. Any help from anyone is highly appreciable. Thank you.
Replies
2
Boosts
0
Views
1.4k
Activity
Mar ’22
Apple Watch series 2 on OS 6.2
I have an Apple Watch series 2 which is on OS 6.2 and an iPhone on iOS 15.3.1 The Apple Watch doesnt appear to be transferring any data to Apple Health. The phone data is showing and the watch is showing as paired within the My Watch Tab on the Watch App . is this just due to not being compatible?
Replies
1
Boosts
0
Views
790
Activity
Mar ’22
CLKTimeIntervalGaugeProvider alternative in Swift UI
Is there a way to build a complication with a PogressView / Gauge that updates it's progress based on a start and end dates like CLKTimeIntervalGaugeProvider ?
Replies
1
Boosts
0
Views
1k
Activity
Feb ’22
How to communicate with other apps in the standalone Apple Watch app
I haven't developed an Apple Watch app yet. I have an existing app for sale. Users of that app sometimes send me requests for functions using Apple Watch in the app by email. Considering future maintenance, I would like to sell the Apple Watch app as a paid app. However, I know that watch app support cannot be turned on/off by in-app purchases in existing apps. Is there any way for the standalone Apple Watch app to communicate with my existing paid/free apps?
Replies
1
Boosts
0
Views
744
Activity
Feb ’22
handle never invoked with WKURLSessionRefreshBackgroundTask type
Hi Folks, I am building a SwiftUI based WatchOS app primarily focused on updating a complication using data from a REST API call. I am trying to reproduce the approach to updating complications in the background as described in "Keeping your complications up to date". The trouble I have is that the func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) method on the ExtensionDelegate is never called for the WKURLSessionRefreshBackgroundTask task type. The handle method is invoked for other task types such as WKSnapshotRefreshBackgroundTask. After some refactoring, I have deviated from the approach in the video and I now reshedule the background task in the func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) method of the URLSessionDownloadDelegate. This works fine, and the tasks are being resheduled in the background, but my concern is that there maybe a WKURLSessionRefreshBackgroundTask object lurking in the background for which I haven't called setTaskCompletedWithSnapshot. My session is configured as follows: private lazy var backgroundURLSession: URLSession = { let appBundleName = Bundle.main.bundleURL.lastPathComponent.lowercased().replacingOccurrences(of: " ", with: ".") let sessionIdentifier = "com.gjam.liffeywatch.\(appBundleName)" let config = URLSessionConfiguration .background(withIdentifier: sessionIdentifier) config.isDiscretionary = false config.sessionSendsLaunchEvents = true config.requestCachePolicy = .reloadIgnoringLocalCacheData config.urlCache = nil return URLSession (configuration: config, delegate: self , delegateQueue: nil ) }() and the scheduling code is a follows: func schedule(_ first: Bool) { print("Scheduling background URL session") let bgTask = backgroundURLSession.downloadTask(with: LiffyDataProvider.url) #if DEBUG bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 10 : 60 * 2) #else bgTask.earliestBeginDate = Date().addingTimeInterval(first ? 30 : 60 * 60 * 2) #endif bgTask.countOfBytesClientExpectsToSend = 200 bgTask.countOfBytesClientExpectsToReceive = 1024 bgTask.resume() print("Task started") backgroundTask = bgTask } Does anyone have any idea's why the handle method is not invoked with WKURLSessionRefreshBackgroundTask tasks? Cheers, Gareth.
Replies
2
Boosts
0
Views
1.2k
Activity
Jan ’22
SF Symbol using string interpolation
I was very happy when I saw this: "You can embed a symbol inside a run of text by using string interpolation." Text("Thalia… \(Image(systemName: "chevron.forward"))") Unfortunately this is a feature of SwiftUI and not generally available string interpolation. In places where a string is expected like an Apple Watch Compilcation Text Provider CLKSimpleTextProvider(text: "\(Image(systemName: "heart"))") this doesn't return an inline Image but "Image(provider: SwiftUI.ImageProviderBox<SwiftUI.Image.(unknown context at $18487da20).NamedImageProvider>)" So… Is there a way to include an SF Symbol in a regular string to wiggle it into a CLKSimpleTextProvider?
Replies
2
Boosts
0
Views
3k
Activity
Dec ’21