watchOS is the operating system for Apple Watch.

watchOS Documentation

Posts under watchOS tag

419 Posts
Sort 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 marked as solved
17 Replies
4.3k Views
HI, I have an issue displaying SwiftUI previews with Xcode 14. My project has iOS and an watchOS Target. It also includes a lot of SPM, most of them only used by the PhoneApp. The project build successfully for both iOS and watchOS. I can see that when building the watch target, only SPM that are included in this target are build for for watchOS The issue is when I try to build a swiftUI preview of the watch target. In this case I can see on the build for Preview log that Xcode try to build ALL spm defined in the Xcode project, including the one that are not used by the watch Target, As a lot if spm are for iOS only, and doesn't build for watchOS, the build for preview fails, and I'm unable to preview my swiftUI views on the AppeWatch. Note that my project is working fine on Xcode 13. This issue is easy to reproduce in any Xcode projects containing a iOS and watchOS target by adding a SPM that is only for iOS. Any workaround to fix this issue ?
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
1 Replies
582 Views
I am running the watch on watchOS 9 and trying to enable "developer mode" (which requires a restart). However, upon restart, developer mode remains disabled. I tried several times, but developer mode just won't turn on. any thought how to solve?
Posted
by
Post not yet marked as solved
27 Replies
13k Views
I'm continuously getting this message in Xcode and I can't run my app on my Apple Watch. I'm running the latest versions of everything. I have tried to restart my Mac, my iPhone, my Watch. I tried to unpair and pair it back. Nothing is working. I also updated Xcode to 14.0.1 RC and that didn't help. How can I get this working? We're unable to do any work on our Watch App without this working. Thanks
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
9 Replies
2.5k Views
Hi I just got my Apple Watch Ultra and I am trying to access depth and water temperature with the new CMWaterSubmersion api and I am getting CMErrorDomain 110 (which is CMErrorNotEntitled). Not sure exactly what this means, I am guessing I there is an entitlement missing? https://developer.apple.com/documentation/coremotion/cmwatersubmersionmeasurement
Posted
by
Post marked as solved
2 Replies
2.3k Views
Hello, after the apple event I was stoked to find out I could take my Apple Watch diving with me, but I wanted to go a step further. I am attempting to build a companion dive app to my SUUNTO Eon Core as a backup. The only issue is when I try to find where to get a depth reading from the new Apple Watch Ultra sensor, I can't find any documentation. I've been digging around in sensor kit and nothing has caught my eye. Does anyone have any idea where the documentation for it would be? Any help is appreciated. Thanks!
Posted
by
Post not yet marked as solved
1 Replies
570 Views
I recently submitted app using the option of reset ratings. App went live but ratings did not reset , is this a bug Apple is working on?
Posted
by
Post not yet marked as solved
2 Replies
3.3k Views
Hello everyone, I purchased a level lock touch earlier this year. It’s a lock I have on my front door and side door. One of the ways it can be unlocked is with an NFC card. You can tap the card and the lock opens. Since the apple devices have NFC, and so does the level lock touch, I figured there must be a way to just unlock the door by tapping my devices. I asked apple about this and they said they couldn’t help me. I reached out to Level and they said apple will be selling a new level lock + which on October 21st which does exactly what I’m wanting to do….for $329! my question is, if both devices have NFC- couldn’t there just be some type of software update to allow this feature to happen. Instead- someone has to purchase a whole new lock!? I know it’s all about money but it just doesn’t make sense to me. does anyone maybe know of a third party app that can read the level lock nfc card and allow me to open the lock by tapping my device? In the mean time I’ll keep looking for another way besides shelling out another 329 for a lock. Smh
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
23 Replies
7.3k Views
I have an iPhone 14 running iOS 16.1 and my series 5 watch running watchOS 9.1. I was able to turn on Developer Mode on the phone by going to Settings--> Privacy & Security --> Developer Mode. On the watch however (I'm doing this directly on the watch and not on the watch app on the phone) once I'm in Privacy & Security, there is no option to select Developer Mode. How do I get my watch in Developer Mode in order to get a successful build in xCode?
Posted
by
Post not yet marked as solved
8 Replies
1.5k Views
This happens with new project recently created. Existing app is working fine. I can run and debug my watch app from Xcode on my Apple Watch device, but app gets deleted after stop running from Xcode. App is just gone for some reason. Tested with Xcode 14.0.1 and Xcode 14.1 RC 2, and Apple Watch on watchOS 9.1. This was happening before watchOS 9.1. Is anyone see this happening and know solution?
Posted
by
Post not yet marked as solved
1 Replies
1k Views
I have an iOS/wOS app that launched last year. Now I want to add complications to it and use the new way of doing complications with WidgetKit. I have everything in place up to the point where I'm supposed to read the data from Health to display it, where it fails with Missing com.apple.developer.healthkit entitlement. This is the new extension I've added It's embedded in the WatchKit app NOT in the WatchKit Extension and I've added permission to read health data directly in the info.plist for the extension I pull the data from the TimelineProvider protocol method func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) { let currentDate = Date() var entries: [WorkoutEntry] = [] ComplicationHealthManager.loadPreviousWorkouts { workout in let workoutEntry = WorkoutEntry(date: currentDate, workout: workout) entries.append(workoutEntry) let timeline = Timeline(entries: entries, policy: .after(currentDate)) completion(timeline) } } with the help of a small manager class class ComplicationHealthManager: ObservableObject { static func loadPreviousWorkouts(completion: @escaping (HKWorkout?) -> Void) { let healthStore: HKHealthStore = HKHealthStore() let workoutPredicate = HKQuery.predicateForWorkouts(with: .traditionalStrengthTraining) let compound = NSCompoundPredicate(andPredicateWithSubpredicates: [workoutPredicate]) let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierEndDate, ascending: false) let query = HKSampleQuery( sampleType: .workoutType(), predicate: compound, limit: 0, sortDescriptors: [sortDescriptor]) { (query, samples, error) in guard let samples = samples as? [HKWorkout], error == nil else { completion(nil) return } let calendar = Calendar.current let todaysSamples = samples.filter{ calendar.isDateInToday($0.endDate) }.last completion(todaysSamples) } healthStore.execute(query) } } The issue is in the closure for the health query where it returns with no workouts but an error stating Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo={NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.} The problem here is I don't understand where and how to add an entitlement for the complication extension or the WatchKit app, as none of them have the option for health. I have a health entitlements set for the iPhone app and the WatchKit Extension.
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
I was following the below documentation for getting the Raw Gyroscope events. Somehow I am unable to make the below code working. if motion.isGyroAvailable { self.motion.gyroUpdateInterval = 1.0 / 60.0 self.motion.startGyroUpdates() // Configure a timer to fetch the accelerometer data. self.acceTimer = Timer(fire: Date(), interval: (1.0/60.0), repeats: true, block: { (timer) in // Get the gyro data. if let data = self.motion.gyroData { let x = data.rotationRate.x let y = data.rotationRate.y let z = data.rotationRate.z // Use the gyroscope data in your app. print("rotationX: \(x) , rotationY: \(y) , rotationZ: \(z)") } }) // Add the timer to the current run loop. RunLoop.current.add(self.acceTimer!, forMode: .default) } https://developer.apple.com/documentation/coremotion/getting_raw_gyroscope_events The isGyroAvailable always returns false Dev environment - Xcode 14.1, Apple Watch 8, WatchOS 9.1
Posted
by
Post not yet marked as solved
5 Replies
1.1k Views
Hi, I'm trying to locate the app store receipt in the apple watch in order to send it to my server to verify. I'm using the Original API for In-App Purchase because my app needs to support watchOS 7.0 My watchOS app is an independent app still pending to release to App Store. I'm testing using TestFlight, and I have one-month subscription in state "Ready to submit". The process of purchase finishes fine in the apple watch -sandbox success screen- but then, when I invoke SKReceiptRefreshRequest in order to ask Apple for the Bundle.main.appStoreReceiptURL to download in my device and send it to my server to verify, I always get the following error: <SKReceiptRefreshRequest: 0x16df52c0>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=507 "Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/IvooxAppleWatch%20WatchKit%20App.app/PlugIns/IvooxAppleWatch%20WatchKit%20Extension.appex/" UserInfo={NSDebugDescription=Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/MyApp%20WatchKit%20App.app/PlugIns/MyApp%20WatchKit%20Extension.appex/} And the receipt isn't there, in the path Bundle.main.appStoreReceiptURL. I tried looking for both receipt and sandboxReceipt. No luck. I even tried to list the contents of StoreKit but that directory does not exist on my watch according FileManager. I cannot get rid of the error above. Any help is highly appreciated. Thanks in advance.
Posted
by
Post not yet marked as solved
4 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.3k Views
I'm trying to implement App Intents and App Shortcuts on watchOS. To do that, I included my AppIntent and my AppShortcutsProvider to the WatchKit extension target. The intent has one variable parameter: @Parameter(title: "Category", description: "Category", requestValueDialog: "What are you searching for?") var category: String However, when I speak the invocation phrase to Siri on the watch, Siri immediately responds there's something wrong. My perform() method isn't even called and there's nothing in the log. Is this supposed to work? How could I debug this? Is there a sample app showing App Intents on watchOS?
Posted
by
Post not yet marked as solved
1 Replies
1k Views
I added a Watch app to an existing iOS app using XCode 14.1. (single target template) When using WCSession delegate, so I can message between the apps, I always get isWatchAppInstalled = false. If Icreate the same scenario using XCode 13.x, I have no issues. Has anyone been able to add a watch app to an existing iOS app, create a WCSession object and have isWatchAppInstalled = true? print("Session:activationDidCompleteWith --> IsPaired[(String(describing: session.isPaired))] isWatchAppInstalled[(String(describing: session.isWatchAppInstalled))] isReachable[(String(describing: session.isReachable))]"); displays: Session:activationDidCompleteWith --> IsPaired[true] isWatchAppInstalled[false] isReachable[false]
Posted
by