watchOS is the operating system for Apple Watch.

Posts under watchOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Does Wi-Fi quality affect WatchConnectivity data transfers?
I work on an Apple Watch app that can preview what the iPhone camera sees, as well as controls it. I had one report of video quality seen on watchOS, both in resolution and FPS. The only time I've been able to reproduce this is with the "poor network quality" preset in the network link conditioner. Does this mean that the quality of the user's Wi-Fi connection is affecting their WatchConnectivity transfers?
0
0
547
Aug ’23
Watch app doesn't receive location updates on watchOS 10 beta
Since the iOS 17 beta 6 update, my SwiftUI-based watch app, which serves as a companion to the phone app, no longer receives any location updates. Even though the permissions are set to 'When In Use' on the phone, the CLLocation delegate returns the following error every time the app requests a location update: Error Domain=kCLErrorDomain Code=1 "(null)" - The operation couldn’t be completed. (kCLErrorDomain error 1.) Additionally, the SwiftUI map does not display the user's location, indicating that the issue is not related to my CLLocationManager implementation on the watch. While debugging on the watch, I observed that the service acknowledges the permissions as granted. On the phone, my location is displayed accurately. On watchOS 9.6, the same watch app receives location updates as expected. Furthermore, other apps on the watch receive location updates accurately, even on watchOS 10 beta. This issue is not isolated to my device; my colleagues have experienced the same problem with the TestFlight build. I suspect that there may be an issue with my project configuration, although I am unsure why this was not a problem before the watchOS 10 beta. Currently, I am attempting to resolve the issue using: Xcode 15.0 beta 8 (15A5229m) watchOS 10 21R5349b iOS 17 21A5326a It is important to note that the issue is also present in watchOS 10 21R5355a.
28
9
5.3k
Oct ’23
How can I get the highest sample rate historical heart rate data from health store?
I am trying to get heart rate data from health store but when I make a query there are samples that come through with timestamps that shows that there are minutes that go by between the sample measurements. I remember watching an apple video where they were talking about the Quantity series and how these series have one kind of container for multiple data points of bpm data. I also see in the samples that there is a unit of " ___ counts per second" for each of the results so it would make sense if there were multiple datapoints within each of the results from the query but I don't know how to see what's inside of the results or if there is even anything more to them. This is the code I am using to retrieve the data: public func fetchLatestHeartRateSample(completion: @escaping (_ samples: [HKQuantitySample]?) -> Void) { /// Create sample type for the heart rate guard let sampleType = HKObjectType .quantityType(forIdentifier: .heartRate) else { completion(nil) return } /// Predicate for specifying start and end dates for the query let predicate = HKQuery .predicateForSamples( withStart: Date.distantPast, end: Date(), options: .strictEndDate) /// Set sorting by date. let sortDescriptor = NSSortDescriptor( key: HKSampleSortIdentifierStartDate, ascending: false) /// Create the query let query = HKSampleQuery( sampleType: sampleType, predicate: predicate, limit: Int(HKObjectQueryNoLimit), sortDescriptors: [sortDescriptor]) { ( _, results, error) in guard error == nil else { print("Error: \(error!.localizedDescription)") return } print(results ?? "Error printing results.") completion(results as? [HKQuantitySample]) } healthStore.execute(query) } Ultimately I want the most frequent heart rate data that is available. Ideally a bpm measurement every 5 - 10 seconds or less. Is this possible if I have not explicitly saved this heart rate data to the health store for a user before trying to access it or does Apple store all of this information in the health store regardless of the circumstances? Any help is greatly appreciated!
3
0
758
Sep ’23
Building complex navigation stack in watchOS 10
I am having issues presenting one sheet on top of another. Looking into the Mail app presents a long navigation stack. List of email accounts (1) > list of messages (2) > single message view (3) > text field and suggestions list (4) 1 and 2 use new main & detail navigation with nice circular back button. You can select any message (2), and then you can hit Reply in the bottom right corner. I assume this shows a sheet (3). From the sheet select any option, like Reply. That shows another sheet with a text field and suggestions depicted below. (4) It looks like the whole navigation stack is preserved because dismissing the top sheet, shows the previous one. When I try to do the same in my app I see this nice warning message. Currently, only presenting a single sheet is supported. The next sheet will be presented when the currently presented sheet gets dismissed. UIKit speaking, in watchOS you can only present views, except, main & detail navigation introduced in watchOS 10, you can't push views. It seems like the Mail app somehow does it. I am wondering if is it a private API. I will explore 2 NavigationSplitView presented on top of each other and will report back.
2
0
538
Sep ’23
User Notifications Delayed on Watch
Hi, when sending notifications either via APNS remotely or locally on watchOS, they are delivered with a small but significant delay of ~12 to 20s. That doesn't sound like much, but when e.g. the notification is read on AirPods by Siri via the iOS companion app on the phone it's quite annoying having to wait for the long-look notification UI to appear on the watch to e.g. send a quick reaction. Interesting: If the watch is not connected to the phone, notifications are delivered as quick as on the iPhone (<1s delay). That makes me think that this behavior must be related to the notification forwarding feature as described here https://developer.apple.com/documentation/watchos-apps/enabling-and-receiving-notifications . For a "Dependent watchOS app with an iOS app" it is stated that "You can either send the notification just to iPhone, or send it to both devices. In either case, the system ensures that the user only receives one notification at the best destination." So the watch must somehow coordinate with the iPhone to not show a notification if the "same" (same APNS collapse id?) notification is delivered to the phone as well (?). Is there a way to disable this behavior? Thanks! Quirin
2
0
910
Sep ’23
WatchOS app with iOS app
I have an iOS phone educational sports app. There is one small section where the user can track their stats. It is a very minor part of the app (perhaps 1% of the app content). It would be perfect for a watchOS app on its own. Can I create a separate standalone watch app even when the content is included in my phone app when it is a very insignificant part of the iPhone app?
0
0
428
Sep ’23
Initial sync of watchOS app using Core Data and CloudKit
I have an existing iOS/watchOS app that uses a third-party database and WatchConnectivity. For various reasons I am migrating the app to use Core Data with CloudKit. I have everything working using NSPersistentCloudKitContainer. Sync between the iOS and watchOS app are working on my test devices when I start with an empty database. However, I need to import existing user's data when they first install this new version. Some users may have hundreds or thousands of records, but the total database size is under 1-2MB. Data migration/import is working on the iOS side, the Core Data entities are populated on first launch and uploaded to CloudKit (I see in the debug logs that a NSPersistentCloudKitContainer.Event export ends successfully). The problem is launching the watchOS app does not sync the data from CloudKit. I see a import started event but never see it end. I never see any Core Data entities appear on watchOS even after waiting several minutes and re-opening the Watch app multiple times. New entities or modifications made on either app are also not synced. Is the problem just too much data which causes the CloudKit sync to never finish? What are the best practice to populate a watchOS app with initial data from the parent iOS app and keep it in sync with CoreData/CloudKit?
3
1
774
Sep ’23
How can users download an old version of a watch app?
I have just released a new version of my watch app, which requires watchOS 8 and is therefore not usable by series 2 and older watches. Is there any way that users with those watches can get the previous version of the app? The new version of the iOS app runs on their phones but the watchOS app will not run on their watches, so they need to use the old version of both. Thanks in advance.
3
0
1.4k
Sep ’23
AWS Amplify Network error on Watch OS device
I have created a voice recorder application for watch only app in xcode. The logic is when the user stops the recording, the recorded audio file is transferred red to AWS S3 bucket. The code is working fine when I run the app on Xcode Watch OS simulator. But when I install it on the physical watch, every time it is giving network error. I have added all the required permissions and also pinged a basic website and it returned as OK. Amplify Framework Version 2.17.1 Amplify Categories Storage Dependency manager Swift PM Swift version 5.8 CLI version 12.4.0 Xcode version 14+ LOGS: 🔍 File exists, proceeding with upload. 🔍 Network available: true 🔍 Uploading Recording_09-10-2023_22-51-23_966 🔍 Data size: 43304 bytes 2023-09-10T22:51:34-0500 info CognitoIdentityClient : [Logging] Request: POST https:443 Path: / Content-Type: application/x-amz-json-1.1, User-Agent: aws-sdk-swift/1.0 api/cognito-identity/1.0 os/watchOS/9.6.1 lang/swift/5.8 lib/amplify-swift/2.17.1, Content-Length: 79, x-amz-user-agent: aws-sdk-swift/1.0, / Host: cognito-identity.us-east-2.amazonaws.com, / X-Amz-Target: AWSCognitoIdentityService.GetId / Optional([]) 2023-09-10T22:51:34-0500 info SerialExecutor : [Logging] Creating connection pool for Optional("https://cognito-identity.us-east-2.amazonaws.com/?")with max connections: 50 / 🛑 Full error object: StorageError: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.) Recovery suggestion: Check your network connection, retry when the network is available. HTTP Response stauts code: nil 🛑 Storage error: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.). Check your network connection, retry when the network is available.
1
0
495
Sep ’23
Navigate to Apple application programmatically
Hello! I was wondering whether or not it was possible for: An application to programmatically open up an Apple app (i.e. navigate to the ECG app on the Apple Watch for my case) through some framework or internal URL? A background thread of my running application (which is occurring through a workout session) to issue a command to come back to it's main page of the application? This would help in a systematic data-gathering flow which requires me to gather ECG data and then return to the application for further action without too much action on the user's behalf. Thank you!
0
0
296
Sep ’23
Custom UI with Callkit on WatchOS
I need a custom UI/visuals for voice calls, but I'm having a hard time getting it working. I'm basing the project off of the example SpeakerBox-Watch project, which has custom UIs for calls in the iOS project, but seems to just use the system UI in the WatchOS project. I would simply like to show an image while the call is happening, and hide the image when the call has been terminated. Is there any way to do this Using CallKit on WatchOS, or simulate something similar using the streaming audio? I've attempted to get around this with pure HTTP requests in an app which is recording audio, instead of web sockets and callkit, but the latency/behavior is not acceptable for voice calls.
0
0
513
Sep ’23
Submerged Depth and Pressure entitlement
Following the information of accessing the Submerged and Depth and Pressure data (https://developer.apple.com/documentation/coremotion/accessing_submersion_data), I would like to get the Submerged Depth and Pressure entitlement. I went to Certificates, Identifiers & Profiles (https://developer.apple.com/account/resources/identifiers/list) I created an Identifire of Apple ID, Select App, the Capabilitiy of 'Shallow Depth and Pressure' turned true, put my app's bundle ID I created an Profile, select the Identifire I made ealier which have the Capability of 'Shallow Depth and Pressure' I went back to X-code, applied the profile I made earlier I woudl like to know whether I need to add the capability of 'Shallow Depth and Pressure' on X-code. I looked for the menu to add Capabillity on the X-code 'Signing & Capabiities' tab and '+ Capability' nemu, but 'Shallow Depth and Pressure' is not on the lists. If anyone could share your info to get Submerged Depth and Pressure entitlement successrully on X-code, it would be appreciated.
3
0
651
Sep ’23
OAuth and Apple Watch authentication
I work in an app that has a companion Apple Watch app. Previously, we used a token for authenticate request that didn't really expire, now we are fixing this and using an OAuth provider for the authentication token. Now, with the username/password of the user we get an OAuth token for the iOS app. We can refresh the OAuth token only once, after that, the refresh token gets invalidated. That's not a problem for the iOS app as we get a new access/refresh token. In the case of the watch app. I'm curious which kinds of strategies do people use to authenticate the user in the watch app. Previously, we just shared the non-expiring token via watch connectivity and that was good enough. Now we won't be able to do that with the iOS app's OAuth token, as we can only use the refresh token once. So sharing that token between 2 apps doesn't work. I wonder what people use in this situation? specially for users that are already logged in, so we cannot get an independent token for the watch app with the username/password combination. how do you use OAuth between the iOS and watchOS apps? which oauth flows do you use in your apps? how would you solve this case? thanks!
1
0
717
Sep ’23
No swimming distances on watchOS 10
For some reason I am not receiving HKQuantityTypeIdentifierDistanceSwimming samples when using the watchOS 10 beta (8). The same code works fine on watchOS 9 but not on watchOS 10. I have tried specifically enabling them in the collection types for the live builder and /or starting a query for them, but neither approach is causing any samples to be returned to the app. Is this a known issue? Has something changed for swimming in watchOS 10? Thanks in advance.
4
0
1.1k
Oct ’23