watchOS is the operating system for Apple Watch.

Posts under watchOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Text(date, style: .timer) issues with watchOS widget
I'm using Text(date, style: .timer) to display a timer in a WatchOS widget, which works great. The problem is that when the watchface goes dim the time goes from showing the time as "MM:SS" to showing "M minutes". Why is this occuring and how can I change the behavior? I understand it needs to remove seconds to preseve battery life, but why it is putting the word "minutes" at the end, this is messing up my layout. Thanks.
1
0
211
Oct ’24
My Custom Watchface
Dear all, i am a music conductor and developer, and to fulfill my joy with music i recently developed a WatchFace and some apps for a non-apple watch called "PineTime". My whole development is done in c++ and is available at https://github.com/luto65/PineConductor/ Since I am aswell an apple developer, and most of my friends have apple watches, i am now porting those c++ apps to the apple watch. I just finished the very first one, that is actually a watch Face I now ported it to appleWatch and it looks pretty similar too (here a screenshot from the simulator) I would like to now remove the annoying digital hour on the top right corner, and then sell it as new custom face, together with my other swift-ports of my original c++ applications. Looking forward any feedback.
1
0
198
Oct ’24
Healthkit HKWorkoutSession state not transitioning
Im building a workout app to track swimming workouts for watchos 11. Triggering .prepare() on my HKWorkoutSession does not change the session state HKWorkoutSessionState. Below is my prepare function which should transition the session state to HKWorkoutSessionStatePrepared. Nothing is thrown in the delegates, the state just wont change? I have tried erasing, restarting, use another version of xcode and another simulator runtime. func prepare() { guard self.session == nil else { fatalError("Session already exist") } // Configure Workout Type let config = HKWorkoutConfiguration() config.activityType = .swimming config.swimmingLocationType = .openWater config.locationType = .outdoor self.Workoutconfig = config // Create Session do { guard store.authorizationStatus(for: .workoutType()) == .sharingAuthorized else { fatalError("Lack of permission to start workout") } let session = try HKWorkoutSession(healthStore: store, configuration: config) self.session = session self.builder = session.associatedWorkoutBuilder() Logger.diveController.info("Successfully created workout session") builder?.dataSource = HKLiveWorkoutDataSource(healthStore: store, workoutConfiguration: config) self.session?.delegate = self self.builder?.delegate = self if self.session == nil { fatalError("No workout session created") } if self.builder == nil { fatalError("No workout builder created") } self.session?.prepare() logger.debug("Session Started at: \(self.session?.startDate ?? Date())") logger.debug("Session State: \(self.session?.state.description ?? "")") if self.session?.state != .prepared { reset() fatalError("Failed To Prepare") } } catch { Logger.diveController.error("Error starting workout session: \(error.localizedDescription)") } }
1
0
278
Oct ’24
Canniot enable Developer Mode on my Apple Watch Series 7?
Hi to all, I'm new to WatchOS development and trying to enable the Developer Mode on my Apple Watch Series 7. I've enabled Developer Mode on my iPhone and did the same on my Apple Watch. After enabling Developer Mode on the watch it asks me to restart the watch. After a restart it asks me again if I want to enable Developer Mode. Of course! I don't succeed in installing the app on my watch because Xcode is "waiting for first unlock" of my watch. When I look in Settings > Privacy > Developer Mode the toggle switch is disabled. I can enable the switch but the watch asks me to restart and this is the loop I'm in. Anybody suggestions for 'permanently enabling' Developer Mode on my Apple Watch? Thanks in advance!
1
0
207
Oct ’24
Hand Gesture Controls in an Apple Watch App
Hello everyone! I want to add hand gesture controls to my Apple Watch app. Specifically, I’m looking to implement the following gestures: 1. Tapping index finger and thumb together once 2. Tapping index finger and thumb together twice 3. Fist clench 4. Double fist clench Each gesture should trigger a different action within the app. However, I can’t find any information on how to implement this. I only came across an example using .handGestureShortcut(.primaryAction) (Enabling the double-tap gesture on Apple Watch https://developer.apple.com/documentation/watchOS-Apps/enabling-double-tap), but I need to handle four distinct gestures. Is this possible in watchOS 11? Any guidance or examples would be greatly appreciated! Thank you!
1
0
236
Oct ’24
Xcode 16.1 beta 3 unable to connect to my Watch
Xcode Version 16.1 beta 3 (16B5029d) -- Watch Series 9 Version 11.1 (22R5569a) -- iPhone 16 Pro Version 18.1 (22B5069a) The current WatchOS version has introduced a UI bug in NavigationView.navigationTitle - and I'm attempting to install a new version of my App on my Watch. This watch was previously sync'd with an iPhone 13 Pro - which is no longer associated with my AppleID since I'm using my new iPhone 16 Pro. The watch is paired with the 16 Pro, and in previous versions of Xcode 16.1, I was able to compile and run my all of my apps on the Watch. In the current beta 3, instead I get a dialog box which states: Connecting to Apple Watch Xcode will continue when the operation completes. and this dialog box persists until the timeout (which is several minutes). Any help?
2
0
256
Oct ’24
WatchOS local notifications delayed
I'm scheduling local notifications on my WatchOS app, but they are always alerting exactly 13 seconds later than scheduled. I have read other users having the exact same issue but there is no solution anywhere. I'm not sure how one is supposed to write any sort of timer app when they are always coming in delayed. Any idea why this occurs and how to resolve it? For now I am subtracting 13 seconds from the end time, but that's not really a solution I'm happy with. Thanks
2
0
267
Oct ’24
How to disable Live Activity on Apple Watch while keeping it enabled on iPhone?
I'm using Live Activity features in my app, but I want to customize the user experience across different Apple devices. Specifically, I'd like to: Keep Live Activity enabled and functioning on the iPhone Disable or prevent Live Activity from appearing on the connected Apple Watch Is this level of device-specific control possible with Live Activity? If so, what's the best approach to implement this functionality? What I've tried: I've looked through Apple's documentation on Live Activity, but couldn't find specific information about device-level control. I've experimented with ActivityKit, but haven't found a clear way to distinguish between iPhone and Apple Watch when pushing updates.
4
0
406
Oct ’24
App Not Appearing in "Available Apps" List in Watch App
I’ve developed an Apple Watch extension for an existing iOS app. When I run the app on the watch via Xcode using the simulator, everything works fine. However, when I try to install it on my iPhone, the Watch app doesn’t show it in the "Available Apps" list, so I can't install it on the watch. The Apple Watch is connected to my iPhone, and I can see other apps available for installation without any issues. I also created a brand new project with watchOS support to troubleshoot, but the same problem occurred. Any ideas on how to resolve this?
0
0
220
Oct ’24
Apple Watch logo requirements for app's notifications
I have an iPhone/iPad application for which there is no watchOS target and as such no separate Watch app. I do not have separate watchOS app icons included as well in Assets. However, an Apple Watch is supposed to receive push notifications for the application. Do we as app developers need to provide watchOS app icons, with different resolutions as suggested by Apple in HIG, in app's Assets for the app logo to appear properly in the notification coming in watch, for both short look and long look? As of now, my app's icon appear pixelated in short look and I am not sure whether it is an app icon issue or because I did not include watchOS app icons in Assets.
2
0
492
Oct ’24
WKApplication.didBecomeActiveNotification not fired when Control Center (or other system overlay view) dismissed by system
https://forums.developer.apple.com/forums/thread/685317 Having read the above discussion, I can add there’s one problematic exception on watchOS to the rule that .didBecomeActiveNotification is fired when the Control Center or any other overlay (such as a long-look notification) is dismissed. It’s when it’s dismissed not by the user, but just allowed to dsimiss itself after a period (as determined by Settings > Wake Duration). This is a problem for any Watch workout app because when one of these overlays is covering the app, it’s considered by the system to be backgounded for purposes of applying the 15% avg CPU load over 60 seconds criteria for being terminated for using too much CPU in the background, so I have discovered. In the case of these overlays covering an app, the app never gets a .didEnterBackgroundNotification call to know that it should attempt to reduce its activity, when the user presses the Side Button to show the Control Center, which is by design, as I understand it. The app does get a .willResignActiveNotification when the Control Center covers it, but there is no corresponding .didBecomeActiveNotification when the system dismisses the Control Center after 2 minutes or so. So if the app reduces its actvity in an attempt to reduce CPU load when covered by the Control Center overlay, it has no way to know it has become active again, in the special case of the Control Center timing out and being dismissed by the system. What could be done to reduce the likelihood of the system terminating the app in this situation, and maintain the app's functionality and usability?
2
0
284
Oct ’24
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
338
Oct ’24
I can't unlock my MacBook Pro M1 using OS 15 and 15.1
I started a thread stating the above and apparently I am not the only one to encounter this issue. My Apple Watch is the version 10 and I certainly didn't expect to have this problem. My older Apple Watch did have this same problem initially but after a few updated it stated working. I only tried the consumer beta hoping the issue was resolved. One of the posts today hoped the next update would fix it and I informed him I had installed the beta and it still wasn't working.
2
0
254
Oct ’24
"validate settings" missing from xcode16 ?
I’d like to migrate my watchOS app (bundled with an iOS app) from a dual-target to a single-target setup. I remember Xcode used to have a menu item (Editor -> Validate Settings) that would prompt you to initiate the migration process. However, I can’t seem to find a ‘Validate Settings’ option in the latest Xcode 16. Has "Validate Settings" been removed in xcode16 ? Thanks!
1
0
223
Sep ’24