Watch Complications

RSS for tag

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

Complications Documentation

Posts under Watch Complications tag

58 Posts
Sort by:
Post not yet marked as solved
2 Replies
2.3k Views
Hi, I'm developing an independent WatchOS application, and trying to use background URL sessions to download new content for complication update. I think my download tasks are scheduled up appropriately, during a background refresh, following all documented guidelines from apple documentation. Everything seems to work as intended on the simulator. But when running on the real device (from XCode, using a self-signed certificate), the updates become quite unreliable (and the debug process is very frustrating btw). Most of the times, the scheduled download never finishes until the app returns to foreground. And I get the following error in the logs : BackgroundSession ... connection to background transfer daemon [interrupted | invalidated] I read that this might be due to a code signing issue. Does it mean that I have to register to an apple developer account to get it working on the real device ? (Needless to say that I'm not naturally inclined to subscribe while I'm not sure to get the app running as intended...) Thanks a lot for any help
Posted
by
Post not yet marked as solved
4 Replies
2.3k Views
My watchOS app crashes when I accept/change the microphone or Bluetooth permission from its companion iOS app. It crashes with the following message in the console. Message from debugger: Terminated due to signal 9 Please let me know a way to identify and fix the exact problem. here are my device logs: Device logs and crash report
Posted
by
Post marked as solved
7 Replies
4.3k Views
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
Posted
by
Post not yet marked as solved
6 Replies
2k Views
I'm trying to build a WatchOS 9 corner complication with WidgetKit (using Xcode 14 beta 3). I'd like my complication to look like the battery one in the bottom right corner. Here's my view: struct HydrationProgressCorner: View {     var entry: Provider.Entry     var body: some View {         Text("\((100 * entry.progress / entry.target).rounded(.towardZero).formatted())%")             .widgetLabel {                 ProgressView(value: entry.progress, total: entry.target)                     .tint(.blue)                     .widgetAccentable()             }     } } How can I get my text to follow the curvature of the watch face?
Posted
by
Post not yet marked as solved
6 Replies
2.9k Views
When an iPhone is paired with an Apple Watch and receives a critical alert, no sound is played. This makes it very easy to miss such notifications and defeats entirely the purpose of critical alerts. For context, we build an app that improves the care coordination of heart attacks. We send critical alerts to notify healthcare professionals of such emergencies. These events may occur at night, when the user does not wear the Watch, and will therefore be likely to miss the notification entirely, which can be catastrophic. I have searched online thoroughly for work-arounds but have not found anything. Others have asked this before elsewhere but have not found definitive answers: link. Is there anything we can do as developers to force critical alerts to be handled by the phone, or at least to force the phone to ring when receiving a critical alert? Edit: I am aware that in the Watch app, it is possible to prevent notifications from being mirrored by the Watch. However, this requires the end user to exit my app and navigate their settings. It is also impossible for my app to check if this was done correctly. As such, I am completely in the blind as to whether the user has set up their notifications correctly.
Posted
by
Post not yet marked as solved
3 Replies
1.2k Views
Hi all, I am working with an older watch app that still uses the older template that combines the WatchKit App and WatchKit App Extension targets. While trying to migrate the ClockKit complication to the new WidgetKit complication, I cannot get the widget complications to load anything from user defaults. It seems like the widget complications are not using the same user defaults as the watch app though being in the same App Group. I experimented with a new watch app using the new SwiftUI template and the WidgetKit complication was able to load data from user default successfully. Did anyone got WidgetKit complication to load data successfully from user default with the older watch app template? Thanks in advance!
Posted
by
Post not yet marked as solved
1 Replies
1.9k Views
I recently raised this post explaining how I couldn't seem to get watchOS 9 complications to work, and I've figured out a partial fix. The original post details the issues with complications - and some are still valid - but this fix applies to both my complications and Home Screen / Lock Screen widgets. I was following the various WWDC 2020/2022 videos and the Emoji Rangers sample code, adding bits here and there, and assuming they were completely valid. Sadly, this bit of code in the widget's dynamic intents IntentTimelineProvider getTimeline really just banjaxed everything: // Create entries for one day, 15 minutes apart let currentDate = Date() for minuteOffset in stride(from: 0, to: 60 * 60 * 24, by: 15) { let entryDate = Calendar.current.date(byAdding: .minute, value: minuteOffset, to: currentDate)! entries.append(EventEntry(date: entryDate, event: event)) } If I remove that, and generate a different timeline with specific dates and times (for example: now, in 10 mins, in 2 hours, in a day, etc.) the complications appear correctly, as do Home Screen and Lock Screen widgets. The outstanding issues with complications are: The previews all use the same data, but getSnapshot() is supposed to return the data specific to that event from the configuration, i.e. if let theId = configuration.event?.identifier. "Christmas" is correct, but "Gallery Opening" is using Christmas's data. Once I've selected the event I want to use in a complication the edit screen shows it as totally blank, not even a placeholder: I hope this little fix works for you guys. And, if you know how to fix the above issues, let me know. (iOS 16.1 beta 1, Xcode 14.1 beta 1)
Posted
by
Post not yet marked as solved
5 Replies
2.2k Views
Hello! Two of my watch apps (HiCoffee and HiWater) occasionally have issues with complications not displaying properly on watchOS 9. I did NOT use the new WidgetKit to implement the complications, all the related code still uses the same previous ClockKit + SwiftUI. I have observed several different types of wrong behaviors. One specific complication cannot be displayed (rendered?), while others do work (from the same app). This indicates that my watch app is working properly. All complications on the face cannot be displayed. But the app logs indicates it's running properly. In addition, when you long press the face to edit complications, yet it can be displayed normally. Log shows CLKComplicationServer.sharedInstance().activeComplications always returns 0 no matter how many complications are added to the face. Also, the ComplicationController is NOT called by system. I'm not using WatchKit. This part of the code in my app has been working properly for a long time and has not been changed. But after the release of watchOS 9, I received a lot of feedback from users with this problem. So I think the problem is in watchOS 9. I haven't found a way to reproduce the problem yet. Any suggestions please?
Posted
by
Post not yet marked as solved
3 Replies
2.5k Views
I've implemented delegate method suggested in the article https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app and double (even triple) checked kind and extensionBundleIdentifier of my StaticConfiguration But when I install the app version containing WidgetKit complications they don't replace old ones from ClockKit on the watch face. In the same time old complications are not displayed - I see empty slots. When I check setup in Watch app on the phone I see that old complications remain assigned. If I switch manually to WatchKit based they work fine. It would be helpful if Coffee Tracker code example (referenced in WWDC video and documentation) become updated with migration code.
Posted
by
Post not yet marked as solved
4 Replies
1.8k Views
I like to keep my apps watch face complication up to date when the user completes an activity but calling WidgetCenter.shared.reloadAllTimelines() is not working as well as the old complication update now I want to go back to complications. I used to call CLKComplicationServer.sharedInstance().reloadTimeline(for: <#T##CLKComplication#>) which would update my complication instantly. The simulator seams to up date widgets immediately but now my app has been released pn the App Store it is not updating. Any one else experiencing this.
Posted
by
Post not yet marked as solved
3 Replies
1.5k Views
I'm trying to migrate from Complication with CLKComplication to WidgetKit. I have implemented the required methods in https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app, but the migration is not working. There is no evidence that the method for migration is also called. It was the same with Xcode 14.0.1 and Xcode 14.1RC. class ComplicationController: NSObject, CLKComplicationDataSource, CLKComplicationWidgetMigrator { ...     @available(watchOS 9.0, *)     var widgetMigrator: CLKComplicationWidgetMigrator {         return self     }     @available(watchOS 9.0, *)     func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) async -> CLKComplicationWidgetMigrationConfiguration? {         return CLKComplicationStaticWidgetMigrationConfiguration(kind: "MyWidget", extensionBundleIdentifier: "com.example.myapp.mywatchkitapp.mywidget")     } } What's wrong? Has anyone been able to migrate?
Posted
by
Post not yet marked as solved
3 Replies
1.7k Views
I’m trying to create complications für the Watch using the new WidgetKit. While the complications do show up fine in the preview in Xcode and also in the Simulator, on a real device the complications do never shown anything. The complications are listed and can be selected in the watch face settings, but the preview is always black, and when added to a watch face, it shows nothing. I can tap on this „nothing“ and the App launches, so the complication is actually there. But it doesn’t show anything. This is also true for the Watch App on the iPhone, which lets me add the complications to a watch face, but it also shows nothing. But in the Simulator everything works as expected, the complications show their content just fine. So it looks like the code is fine. The iPhone runs the iOS 16.1, and the watch runs watchOS 9.1 (right now the latest public releases) Does anyone having the same issue and maybe a solution or a hint, what exactly I should check?
Posted
by
Post not yet marked as solved
2 Replies
1.1k Views
Hello, I try to add a couple of Complications to my App. Most of the Complications needs to be Configurable, so I use an IntentConfiguration for them. I use this recommendations function to create my complications.     func recommendations() -> [IntentRecommendation<ConfigurationIntent>] {         var recommendations = [IntentRecommendation<ConfigurationIntent>]()        for vehicle in vehicleStatusList {             let intent = ConfigurationIntent() intent.vehicleItem = VehicleItem(identifier: vehicle.id, display: vehicle.name)             recommendations.append(IntentRecommendation(intent:  intent, description: vehicle.name))         }         return recommendations     } But with this I get the result from the screenshot... How can I change this to get a better User Experience? When I click one item in the List, I get a correct Complication. But it would be nice to have a change to name them correctly... The first in the List is a StaticConfiguration...
Posted
by
Post not yet marked as solved
2 Replies
1.4k Views
I’ve created a single-target watchOS app in Xcode 14, but I can’t seem to get ClockKit complications working. I’ve added a CLKComplicationDataSource class to my watch target, and in the Info pane for my target I have set the CLKComplicationPrincipalClass key to MODULE-NAME.ComplicationController I haven’t yet added Complication placeholder images to my Assets.xcassets, but as far as I am aware, that shouldn’t be a problem while I am still testing. However, when I run it on a watchOS simulator, the complications never show up on the watch complications list when adding a complication. All of the tutorials I can find for ClockKit complications reference older two-target WatchKit apps. Do the newer single target apps no longer support ClockKit? If so, how can I make a two-target WatchKit app with Xcode 14? Unfortunately I cannot use WidgetKit for my complications because I need to support watchOS 7 at least, and WidgetKit only supports watchOS 9+ Thanks for your help
Posted
by
Post marked as solved
2 Replies
2.1k Views
I have a watch complication that used to work just fine and now all of a sudden in my latest build it's showing only dashes. The watch app is there, if I tap on the complication then the watch app opens correctly, if I edit the watch face and select the complication I can see my placeholder (and it's fine) but when I select that complication, the sample watch face shows dashes. The only major change I've made is to make the watch app a single-target without an extension delegate as per Apple's recommended settings. I don't think this is the problem as the simulator shows the complication. It's only on the Watch Series 4 that I'm testing on that I can't see my complication. It was working only last week and I have not touched the complication code at all, so I'm stumped as to what's wrong. I can't find any help on line, apparently no one has ever seen the complication just have dashes. When I debug the watch app and ask for how many complications there are, it comes back with zero even though I've put them on the watch face. It seems like watchOS9 is just not respecting the complication any longer but I can't figure out why. Please note that I'm not using WidgetKit complications as the corner complication doesn't flow the text in an arc like ClockKit does, so I'm still using the old complications. But none of the code is getting called as none of my breakpoints are firing. I've rebooted the watch about 10 times and the problem persists. Any ideas why all of a sudden this has fallen over and gone boom?
Posted
by
Post not yet marked as solved
0 Replies
566 Views
Watch Standalone App The icon is not displayed in the Watch app on iPhone. We are currently trying to get the Apple Watch Standalone app to be judged. It has been rejected in the current review. The cause is that after installing the app on the watch, the app icon is displayed as a blank image in the "Installed on Apple Watch" item of the "Watch" app, which is the default app of the iPhone. The app icon installed on the watch cannot be displayed in the iPhone's default "Watch" app. If anyone knows of a possible way, please let us know. I've tried a lot of different ways now, but to no avail. Even if I combined the iPhone + watch icon in Watch Assets and installed the watch app, it failed. Even the Apple guidelines given by the reviewer have no relevant information at all.
Posted
by
Post not yet marked as solved
0 Replies
630 Views
Hi Team, I am using the ClockKit to populate my watch app compilations. I have not added the WidgetKit target yet. As Apple start showing warnings for the storyboard in the watch extension, I replaced the storyboard with SwiftUI classes So now my app UI is created from SwiftUI and Complications are from ClockKit But when the watch is upgraded to 9, there are a few issues coming up related to complications most of them are actually related to the timeline and complications are becoming unresponsive So whether Apple still support ClockKit ? or is it mandatory to move to WidgetKIt?
Posted
by