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

30 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Critical Bug in iOS 18.1 RC and watchOS 11.1 RC - WidgetKit Complications Not Syncing
I've encountered a major issue with the iOS 18.1 RC and watchOS 11.1 RC. It appears that complications running on WidgetKit cannot be synced as .watchface to these new release candidates. The error message indicates that "the Watch Faces app and complication are not available," which is affecting all apps utilizing WidgetKit. This issue renders all WidgetKit-based complications unusable on watchOS 11.1 RC. It’s a serious problem for those of us who rely on these complications for our apps and for users expecting consistent functionality. APPLE, PLEASE FIX THIS ISSUE ASAP! This bug is a significant setback for developers and users alike, and any guidance or updates would be greatly appreciated.
3
0
331
4w
Complication Widget using AccessoryWidgetGroup
I want to get which button in AccessoryWidgetGroup was pressed in the Watch App, but I can't. When I use Button(_:intent:), it works in Smart Stack, but it doesn't work in Complication Widget. Using widgetURL(_:) always gets the URL of the first button. Below is a snippet of the code I tried. All codes can be found here. struct MyWatchWidgetEntryView : View { var entry: Provider.Entry var body: some View { AccessoryWidgetGroup("Widget Group") { MyWatchWidgetEntryButton(intent: .init(id: "001", imageName: "star.fill")) MyWatchWidgetEntryButton(intent: .init(id: "002", imageName: "heart.fill")) MyWatchWidgetEntryButton(intent: .init(id: "003", imageName: "leaf.fill")) } } } //Button View private struct MyWatchWidgetEntryButton: View { @Environment(\.showsWidgetContainerBackground) var showsWidgetContainerBackground let intent: MyAppIntent var body: some View { Button(intent: intent) { ZStack { if showsWidgetContainerBackground { Color.black } else { AccessoryWidgetBackground() } VStack { Image(systemName: intent.imageName) .font(.headline) Text(intent.id) .font(.system(size: 10, weight: .bold)) } } } .buttonStyle(.plain) .widgetURL(URL(string: "widget://" + intent.id)) } } Does anyone know how to do this? Thank you.
4
0
339
Oct ’24
Custom SF Symbols don't work on WatchOS 10 .accessoryInline
I'm trying to use a custom SVG as a SF Symbol for a .accessoryInline complication on Apple Watch but it only appear on WatchOS 11. I even tried a fresh project and exported one of the symbols from SF Symbols app to eliminate error with custom symbol creation. On WatchOS 11 it shows correctly and colored, on WatchOS 10.5, no symbol at all. Am I missing some setting or something? Tried different Render As options for the symbol with no luck. For corner complication, it shows it fine (Series 10 is WatchOS 11 here) What is more weird in kinda shows that it's loading in comlication preview: Overall can't use any image for inline complication unless I do it like this: Image(uiImage: UIImage(named: "ImageName") ?? UIImage()) .resizable() Which can't be colored also
1
0
296
Sep ’24
Refresh SmartStack Widget in watchOS 11
Hi, I have an app that provides a SmartStack Widget. The content in that widget is dependent on a state inside the application so from time to time the app needs to update the widget state. I tried: WidgetCenter.shared.invalidateConfigurationRecommendations() WidgetCenter.shared.reloadAllTimelines() However this does not have any effect. I only see updates on reboots (device with watchOS 11 B5) Is there any other way or am I doing something wrong?
2
0
484
Aug ’24
WidgetKit complications do not appear on watchOS 11 beta 5
Third-party WidgetKit complications on watchOS 11 beta 5 are not appearing in the list of available complications. They have also disappeared from watch faces where they were installed. The exact same complications were working fine on earlier betas. This is happening on device, but not in simulator. This issue may be related to FB14684253, which was fixed with the release of Xcode beta 5. However, Xcode beta 5 does not fix the issue on Apple Watch. As a sanity check, I also tried with the Backyard Birds sample project, and the complications for that app aren't appearing on device either. Filed as FB14689021.
3
2
499
Aug ’24
Can't add Widget Extension on WatchOS Target
I can't select my Companion App Target in the Selection Many for "Embed in" in the add Target File. It's a Companion App for a Flutter App. I add the target via File -> New -> Target -> WatchOS -> WidgetExtension The minimum version for the flutter project is iOS 14 and the watch watchOS 10. I tried readding my WatchTarget but it didn't work that time either. I made a dummy project with a default iOS App (No Flutter) and default WatchOS App and there I had the option to select my Companion Target. checking Configuration Intent also changes nothing for the outcome. I also tried adding one into another Runner (Flutter) Project with an Companion App and I run into the same Issue there.
0
0
346
Jul ’24
Updating watchOS complication when data in iOS app changes.
Hello, I'm facing problems when attempting to update my watchOS complication when relevant data on the iPhone app changes. From what I gather reading the documentation I have to use the Watch Connectivity Framework to send said new data from the phone to the watch: use transferCurrentComplicationUserInfo() to send a dictionary of data from the phone to the watch implement the didReceiveUserInfo delegate method to handle incoming data on the watch in said handler, save the incoming data to UserDefaults using an App Group so the widget-extension can read that data after saving the data to UserDefaults, call WidgetCenter.shared.reloadAllTimelines() so watchOS can request fresh timelines for my complications change the getTimeline() method of my TimelineProvider so it uses the received data from UserDefaults OR async fetch fresh data if received data from phone is too old If I understand correctly, transferCurrentComplicationUserInfo() is limited to be used a maximum of 50 times a day. I'm running the apps in debug mode, so this should be no problem. Here is my current implementation: 1 : Setup of my WC class: final class Connectivity: NSObject { // singleton approach static let shared = Connectivity() // used to rate limit transmissions from phone → watch private var lastSentBalanceContext: Date? = nil private override init() { super.init() // no need to check availability on watchOS #if !os(watchOS) guard WCSession.isSupported() else { return } #endif WCSession.default.delegate = self WCSession.default.activate() } } 2 : The method enabling transmission from phone to watch: #if os(iOS) extension Connectivity: WCSessionDelegate { func sendBalanceContext(sample: HealthData) { guard WCSession.default.activationState == .activated else { return } guard WCSession.default.isWatchAppInstalled else { return } // rate limitat transmissions guard self.lastSentBalanceContext == nil || abs(Date.now.timeIntervalSince(self.lastSentBalanceContext!)) > 10 else { return } if WCSession.default.remainingComplicationUserInfoTransfers > 0 { WCSession.default.transferCurrentComplicationUserInfo([ "context": "balance", "date": sample.date, "burnedActive": sample.burnedActive, // more data... ]) self.lastSentBalanceContext = .now } } // boilerplate handlers here } #endif 3 : Delegete method that handles incoming data on the watch: #if os(watchOS) extension Connectivity: WCSessionDelegate { func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:]) { guard let context = userInfo["context"] as? String, context == "balance" else { return } guard let date = userInfo["date"] as? Date, let burnedActive = userInfo["burnedActive"] as? Int /* more data... */ else { return } guard let SharedDefaults = UserDefaults(suiteName: "group.4DXABR577J.com.count.kcal.app") else { return } // TimelineProvider uses this to determine wether to use this data or fetch data on its own SharedDefaults.set(Date.now, forKey: "lastReceivedBalanceContext") SharedDefaults.set(date, forKey: "date") SharedDefaults.set(burnedActive, forKey: "burnedActive") // more data... WidgetCenter.shared.reloadAllTimelines() } // boilerplate handlers } #endif 4 : Finally, the TimelineProvider: struct HealthDataEntry: TimelineEntry { let date: Date let data: HealthData } struct HealthDataTimelineProvider: TimelineProvider { // other callbacks here func getTimeline(in context: Context, completion: @escaping (Timeline<HealthDataEntry>) -> Void) { let SharedDefaults: UserDefaults = UserDefaults(suiteName: "group.4DXABR577J.com.count.kcal.app")! let nextUpdateDate = Calendar.current.date(byAdding: .minute, value: 15, to: .now)! // use data from phone if it is less than 60 seconds old if let lastReceivedBalanceContext = SharedDefaults.object(forKey: "lastReceivedBalanceContext") as? Date { let interval = lastReceivedBalanceContext.timeIntervalSince(.now) if interval > -60 && interval <= 0 { let data = HealthData(date: SharedDefaults.object(forKey: "date") as? Date ?? Date(timeIntervalSinceReferenceDate: 0), burnedActive: SharedDefaults.integer(forKey: "burnedActive"), burnedActive7: SharedDefaults.integer(forKey: "burnedActive7") /* other data ... */) let timeline = Timeline( entries: [HealthDataEntry(date: .now, data: data)], policy: .after(nextUpdateDate) ) completion(timeline) return } } // default: fetch from HealthKit (if received data from phone is > 60s) Task { let timeline = Timeline( entries: [HealthDataEntry(date: .now, data: try! await asyncFetchData())], policy: .after(nextUpdateDate) ) completion(timeline) } } } The issue I am facing is that the watchOS complication only gets refreshed when I acitvely build and run the watchOS app in Xcode and then initiate a transmission of data to the watch. This works even if I do it back to back to back. As soon as I stop the watchOS app from within Xcode, my complications won't update anymore. I noticed this behavior when I used print() statements throughout my code to see whether it is beeing executed as expected. The iPhone sends data, the watch receives it but then the watch fails to update the complications ONLY when not running from Xcode. Can you spot any flaws in my implementation or in my understanding? Maybe transferCurrentComplicationUserInfo() just isn't as reliable as I think it should be? I interpreted it as being practically guaranteed to refresh the complications 50 times a day, pretty much instantly? Any help or guidance would be greatly appreciated!
1
0
832
Jul ’24
Non-tinted image in complications using WidgetKit
I have a watchOS app where a user can select a picture. I’d like the picture to be displayed in a complication. I’m using WidgetKit, and I found out that for some watch faces (rendering mode = accented), the image gets tinted. Instead of the picture, the user sees only a colored box. It appears that using the old framework, ClockKit, it was possible to display an image that gets slightly colored with the tint color on tinted watch faces. I believe this is to ensure backward compatibility of old complications. My question is: can I do the same using WidgetKit? I tried using the widgetAccentable() modifier, but it doesn’t work. Here's an example of what I mean. In the middle complication, instead of the pink square, I'd like to display the user picture.
6
1
988
Jul ’24
File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
After updating to iOS 17.5 & WatchOS 10.5, the didFinish response from WCSessionDelegate does not come when transferring files from iPhone to Watch. It worked normally until 17.4 & 10.4. There is no problem with checking file completion even if a didFinish response is not received, but I think Apple needs to check this issue and update. File transfer is done using the transferFile function of WCSession. The file being transferred is a single file and its size does not exceed 30MB. When you try to transfer Pi, the message below appears in the Xcode log section. -[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer <WCSessionFileTransfer: 0x300155d60, session file: <WCSessionFile: 0x3001575c0, identifier: 0C8857EC-7D74-4E78-BA28-6C5526DE8949, file: /private/var/mobile/Containers/Data/Application/DD797847-DED1-42C0-989F-34CD05825007/tmp/C042D096-F12B-4B50-8792-868475DBBF47.zip, hasMetadata: YES>, transferring: YES> due to Error Domain=NSCocoaErrorDomain Code=4866 "Caught exception during archival: This object may only be encoded by an NSXPCCoder. ( 0 CoreFoundation 0x000000019b064f2c 00E76A98-210C-3CB5-930B-F236807FF24C + 540460 1 libobjc.A.dylib 0x0000000192ef6018 objc_exception_throw + 60 2 Foundation 0x0000000199fe7778 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 1419128 3 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 4 WatchConnectivity 0x000000021d055f60 1AB4DDD6-9238-3965-B744-819F2916C8CC + 126816 5 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 6 WatchConnectivity 0x000000021d0567f0 1AB4DDD6-9238-3965-B744-819F2916C8CC + 129008 7 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 8 Foundation 0x0000000199f30628 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 669224 9 WatchConnectivity 0x000000021d0583ac 1AB4DDD6-9238-3965-B744-819F2916C8CC + 136108 10 WatchConnectivity 0x000000021d04390c 1AB4DDD6-9238-3965-B744-819F2916C8CC + 51468 11 WatchConnectivity 0x000000021d046640 1AB4DDD6-9238-3965-B744-819F2916C8CC + 63040 12 Foundation 0x0000000199ea9be0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 117728 13 Foundation 0x0000000199ea9aa0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 117408 14 Foundation 0x0000000199ea98a0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 116896 15 Foundation 0x0000000199ea7b40 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 109376 16 Foundation 0x0000000199f2c558 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 652632 17 Foundation 0x0000000199f2c1a4 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 651684 18 libdispatch.dylib 0x0000000105ed7764 _dispatch_block_async_invoke2 + 148 19 libdispatch.dylib 0x0000000105ec67bc _dispatch_client_callout + 20 20 libdispatch.dylib 0x0000000105ec98e0 _dispatch_continuation_pop + 676 21 libdispatch.dylib 0x0000000105ec8bb8 _dispatch_async_redirect_invoke + 680 22 libdispatch.dylib 0x0000000105edaae4 _dispatch_root_queue_drain + 404 23 libdispatch.dylib 0x0000000105edb4d8 _dispatch_worker_thread2 + 188 24 libsystem_pthread.dylib 0x00000001f7ebb8f8 _pthread_wqthread + 228 25 libsystem_pthread.dylib 0x00000001f7eb80cc start_wqthread + 8 )" UserInfo={NSDebugDescription=Caught exception during archival: This object may only be encoded by an NSXPCCoder. ( 0 CoreFoundation 0x000000019b064f2c 00E76A98-210C-3CB5-930B-F236807FF24C + 540460 1 libobjc.A.dylib 0x0000000192ef6018 objc_exception_throw + 60 2 Foundation 0x0000000199fe7778 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 1419128 3 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 4 WatchConnectivity 0x000000021d055f60 1AB4DDD6-9238-3965-B744-819F2916C8CC + 126816 5 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 6 WatchConnectivity 0x000000021d0567f0 1AB4DDD6-9238-3965-B744-819F2916C8CC + 129008 7 Foundation 0x0000000199ea0e14 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 81428 8 Foundation 0x0000000199f30628 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 669224 9 WatchConnectivity 0x000000021d0583ac 1AB4DDD6-9238-3965-B744-819F2916C8CC + 136108 10 WatchConnectivity 0x000000021d04390c 1AB4DDD6-9238-3965-B744-819F2916C8CC + 51468 11 WatchConnectivity 0x000000021d046640 1AB4DDD6-9238-3965-B744-819F2916C8CC + 63040 12 Foundation 0x0000000199ea9be0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 117728 13 Foundation 0x0000000199ea9aa0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 117408 14 Foundation 0x0000000199ea98a0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 116896 15 Foundation 0x0000000199ea7b40 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 109376 16 Foundation 0x0000000199f2c558 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 652632 17 Foundation 0x0000000199f2c1a4 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 651684 18 libdispatch.dylib 0x0000000105ed7764 _dispatch_block_async_invoke2 + 148 19 libdispatch.dylib 0x0000000105ec67bc _dispatch_client_callout + 20 20 libdispatch.dylib 0x0000000105ec98e0 _dispatch_continuation_pop + 676 21 libdispatch.dylib 0x0000000105ec8bb8 _dispatch_async_redirect_invoke + 680 22 libdispatch.dylib 0x0000000105edaae4 _dispatch_root_queue_drain + 404 23 libdispatch.dylib 0x0000000105edb4d8 _dispatch_worker_thread2 + 188 24 libsystem_pthread.dylib 0x00000001f7ebb8f8 _pthread_wqthread + 228 25 libsystem_pthread.dylib 0x00000001f7eb80cc start_wqthread + 8 )}
28
13
4.0k
1d
WidgetKit - complication doesn't sync between watch and iPhone
I'm currently working with complication using widgetkit for watchOS. When I select complication from Watch app in iPhone, The complication does not show content. In complication gallery, untitled complication is selecting. But when I select complication from watch, it's OK. This bug occurs in both real device and simulator. But it happen in some pair. Example: watch ultra (os 10.4) pair with iPhone 14 pro (os 17.0): NG watch ultra (os 10.4) pair with iPhone 14 pro (os 16.1): NG watch ultra (os 10.0) pair with iPhone 14 pro (os 17.0): OK I tried create simple project to check this bug. But this bug still occurs This is sample project: Github
0
1
552
May ’24
Widgets without timeline on WatchOS
TLDR; Can I have a widget without a Timeline? My previous watch app had a complication. Simply so it can be added to the watch face for a quick launch of the app. However now seeing that method is deprecated in favour of widgets. Can I add a widget without the need for all the Timeline as all I want is a button on the watch face to launch into my app. No data is updated over time so no need for all the extra timeline code.
1
0
853
Apr ’24
Watch app not listing in complication list of watch app in iPhone
We have an IOS app and its watch extension. The watch extension having complications as well created with clockKit Also we are providing a watch face with our custom complications for the user. Everything working fine watch series 6 and above Now we have an issue reported by a customer in watch series 3 (the watch Os version in 8.8), in which the watch face is not able to add as it showing the error "Watch Face Unavailable" So when we tried to create a another watch face for watch series 3, the complication list on the watch extension as well as the watch app of iPhone are not listing our app name Because of this issue we can't create a custom watch face for the watch series 3 with our complications So why the watch app in iPhone is not listing our watch app name in the list of complications Please update if anyone having similar issues
2
0
745
Feb ’24
How to reduce complication extension executable size?
Hello! I'm working on the watchOS app that provides user with multiple fancy complication sets. There are about 50 widgets in our WidgetBundle now. With this amount we reached memory limit and the app crashes: Thread 1: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=15 MB) I inspected complicationExtension.appex content and find out that most volume is occupied by the executable: Localized strings (12 langs) altogether - 165 KB Assets.car - 1.1 MB Imported fonts TTF files altogether - 866 KB complicationsExtension executable file - 8.2 MB Why it takes so much space and how can it be made smaller?
8
0
1.7k
Feb ’24