watchOS is the operating system for Apple Watch.

watchOS Documentation

Posts under watchOS tag

417 Posts
Sort by:
Post not yet marked as solved
1 Replies
280 Views
Hi everyone, We have a sports app that helps track your game scores. Still, when you are in the middle of a game and receive a notification (e.g., an activity notification, a WhatsApp or third-party app), that notification will pop up on the screen, overlapping the app. This forces you to scroll all the way down the notification and close it before you can continue using the app. Some users are complaining about this, and it's indeed very annoying. I was wondering if there's any way to control that during matches, no notifications pop up on your screen (it's ok to have the red dot on top, but having the notification overlapping is what kills the app's usability). Users can avoid this by choosing the right "focus" mode before starting a new match. However, many don't even know this feature exists or how to deal with it. Is there any way to block incoming notifications from appearing on the screen while the app is being executed?
Posted
by Ataliano.
Last updated
.
Post not yet marked as solved
0 Replies
240 Views
Hello Do we have access to the ECG raw data on the apple watch? I was able to access the data using HKElectrocardiogram Class API. "ecgSample" returns all the recorded ECG logs done by the user using the default apple app. I want to access the data in real-time, do the API supports that? That is, I want to create a custom app in which I direct the user towards recording an ecg signal and then do whatever I want with it. Please let me know, that would be very helpful!
Posted
by zein95.
Last updated
.
Post not yet marked as solved
0 Replies
207 Views
In iPhone, if you open Files app and tap on an associated file type, its corresponding app is launched. I have implemented this functionality in my iOS SwiftUI app - associated a file type - .csk, with my iOS app and handled its launch using the onOpenURL(perform:) modifier. WindowGroup { FileContentView() .onOpenURL(perform: { (fileUrl: URL) in Log(String(format: "File Url = %@", fileUrl.absoluteString)) // Update UI with the content of the file }) } I want to achieve the same for my watchOS app. I noticed that the UTExportedTypesDeclaration key, which is used to declare the file types created and owned by the app, is not available for watchOS. But the CFBundleDocumentTypes key, which is used to associate a file type with the app is available. So, I expect my app to respond to taps on those associated file types, but I've run into a snag. There is no Files app in AppleWatch nor is there a way to view my iCloud storage. I have my .csk file (which is associated with the watchOS app) in iCloud. So, how can I test this launch? How can an AppleWatch user tap a file and view it in his app? It should be possible to handle file launches since CFBundleDocumentTypes is available for watchOS.
Posted
by GangOrca.
Last updated
.
Post not yet marked as solved
0 Replies
304 Views
We have a watch app, that contains TabView with two child views. First Child View have a slider control that supports digitalCrownRotation. Second child view have a normal text on the screen “Hello” When app is launched, the slider in the first view got highlighted when user rotates the Digital Crown but when we moved to Second tab and navigate back to first view, and rotates the Digital Crown, the slider view never gets highlighted but the value of Slider gets changed and value gets changed by any step. This issue was introduced after WatchOS 10.2. Prior to WatchOS10.2 everything worked fine. Could you please assist me to find the solution to resolve this issue?
Posted Last updated
.
Post not yet marked as solved
5 Replies
1.4k Views
Got a little app I am trying to build before launch, I've never built a watch only app, and it requires iOS 17 so I'm a bit stuck. When creating a watch only target, it seems that the template is broken. According to this: https://developer.apple.com/documentation/watchos-apps/creating-independent-watchos-apps/ There should be a blank iOS app target, that contains the watch app. The problem is once I go to build and upload the app to test flight, I get a bundle that Xcode has no clue what to do with (Because it only contains the watchkit app, and no containing xcode app.) I'm guessing my only hope might be to create a watch only app targetted at iOS 9 with Xcode 14, then migrating to Xcode 15? I'm trying that now, but I guess I have another radar to file unless I'm missing something.
Posted
by jclardy.
Last updated
.
Post not yet marked as solved
0 Replies
286 Views
Hi all, I am trying to build an app which, on support Apple Watch's (currently just the Ultra's), will detect when the watch has been submerged and will start to report temperature from the sensor. I have followed the developer articles I could find around CMWaterSubmersionManager and have set up a simple class to interact with it. It is now that I want to run my app and test if it is working as I expect it to etc. However I noticed that the waterSubmersionAvailable is only set to true on physical Apple Watch Ultra and Ultra 2. This is rather inconvenient as it means that for the next week or so while developing this feature I will have to stick my arm wearing the watch into a container of water to test the feature. Just wondering if there is any easier way to debug this stuff that anyone has figured out? It would be ideal if this could just be done in the simulator similar to how other device conditions can be induced. I did notice the "Enable Easy Submersion" option in the Debug menu, however I could not figure out a difference between having this on or off, and could not find any explanation of what it actually does on the docs. Does anyone have any experience with this either? Any advice would be appreciated, and to any Apple engineers who may see this, please please please add an option to be able to debug this stuff in the Simulator
Posted
by devharry.
Last updated
.
Post not yet marked as solved
0 Replies
338 Views
Is there a way to migrate WidgetKit extensions made using dual-target watchOS apps to single-target apps? When you create a widget extension with a dual-target app, the bundle identifier includes the extra extension domain (com.company.app.watchkitapp.watchkitextension.widgets). When Xcode 15 migrates a dual-target to single-target, it removes “.watchkitextension” from both the watchOS app bundle identifier and the widget extension bundle identifier. watchOS seems to handle migrating the main app just fine, but any complications created with the dual-target do not get migrated and are just blank until the user re-configures, which would be a huge bummer to have to ship. If I try to manually set the bundle identifier back to include “.watchkitextension”, the OS rejects the installation because of the extraneous dot after the parent app’s prefix.
Posted
by bbatsell.
Last updated
.
Post not yet marked as solved
1 Replies
270 Views
I am currently developing app that counts the Steps, and for that I am using the pedometer. I am not sure of how frequent pedometer provides updates, in my case it provides update around 3 second. There is nothing mentioned about frequency of Data in Official documentation of Apple or Any ways to set the Frequency. Application is in Both iOS and WatchOS plateform To achieve data i have tried following things: With startUpdates(from: Date) pedometer.startUpdates(from: Date()) { [weak self] pedometerData, error in guard let data = pedometerData, error == nil else { return } DispatchQueue.main.async { self?.stepCount = data.numberOfSteps.intValue } } With queryPedometerData() timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak self] _ in self?.fetchPedometerData() } private func fetchPedometerData() { pedometer.queryPedometerData(from: Date().addingTimeInterval(-1), to: Date()) { [weak self] pedometerData, error in guard let data = pedometerData, error == nil else { return } DispatchQueue.main.async { self?.stepCount = data.numberOfSteps.intValue } } } I have done this both implementation but Not getting desired results. I want data every second, Could it be possible ? Any help or leads would really helpful Thank You :)
Posted Last updated
.
Post not yet marked as solved
0 Replies
205 Views
Hello, For several months now, my watch app will not automatically install when I install local builds from Xcode. If I download our app from the app store, the watch app automatically installs immediately after the phone app (and automatic app install is set to ON in my Apple Watch Settings). But if I install a build from Xcode, I have to manually install the watch app after installing the phone app. How do I get it to go back to the previous behavior where, after I install the phone app, the watch app just automatically installs? It used to do this automatically for me, but no longer does. I want to say this behavior started when I installed the Xcode beta late last year but the behavior has continued on the newest version of Xcode.
Posted
by bryany.
Last updated
.
Post marked as solved
9 Replies
3.2k Views
Right, this is getting on my nerves now. iOS app installed on iPhone via Xcode. Watch app installed on Watch via Xcode. Both apps are running and are in the foreground. iOS app launches on iPhone and reports: WCSession.isSupported = YES theDelegate.session.isPaired = YES theDelegate.session.watchAppInstalled = NO theDelegate.session.activationState = Activated I press a button in the Watch app. It reports: session == activated and reachable iOS app delegate receives a message from the Watch app: didReceiveMessage (from Watch): message = {     action = giveMeUpdatedItems; } The apps must be installed on the devices in order for the Watch app to have used sendMessage (which is only available if the session is reachable, which it is). iOS app delegate passes that through as a notification to another bit of code that collates the info and sends it back to the Watch app. watchNotificationUpdateData; userInfo = {     action = giveMeUpdatedItems; } That bit of code in the iOS app checks whether we can send data to the Watch app, and doesn't send the data because: WCSession.isSupported = YES theDelegate.session.isPaired = YES theDelegate.session.watchAppInstalled = NO theDelegate.session.activationState = Activated If I remove the check for watchAppInstalled, I get this: Error sending Watch application context: Watch app is not installed. {     NSLocalizedDescription = "Watch app is not installed.";     NSLocalizedRecoverySuggestion = "Install the Watch app."; } I've deleted and reinstalled the app on both devices countless times. I've rebooted the devices, plus the Mac. I've reinstalled Xcode. I've cleaned builds. I've deleted DerivedData. And still it says the companion app isn't installed.
Posted
by darkpaw.
Last updated
.
Post not yet marked as solved
5 Replies
835 Views
I have a Watch companion app. The SwiftUI previews fail to build for the watch app. The errors indicate it is trying to build Swift package targets that are meant for iOS only, not the watch. The watch does not include these dependencies so it is perplexing it will try to build them. Digging into the scheme for the watch app, it includes the iOS target as you can see the screenshot. This seems to be the default when you create a new watch target. If I uncheck the boxes for the iOS target, previews will build fine. But I think this means that each time I build my Watch target, it will not simultaneously build my iOS target. I'm not sure of the impact of that. Is this a known limitation with Previews? Is there another workaround?
Posted Last updated
.
Post marked as solved
1 Replies
227 Views
I have had issue with sleep focus on my watch 8 since late in the iOS 16/ WatchOS 9 betas. I opened a feedback in Oct 2023 when 10.1 betas. When sleep focus is on the watch shows it's active and did not alert but it still works like normal. It used to go dark and I could tap the screen to see the time and press the crown to exit from that mode to use it. I wish this would be fixed. I'm tried of having to use theater mode with I go do bed. The light of the watch is
Posted Last updated
.
Post marked as solved
2 Replies
914 Views
Hi everyone, We're fighting an issue that's driving us up the wall. We developed an Apple Watch Only standalone app, which cost $2.99; once you paid, you could download and use the app on your Apple Watch. We've released a companion iOS app for iPhone that goes into the same bundle (as it's the same app, now supporting two platforms). Nevertheless, the Watch app is still available as a separate app (you can download the Watch app only if you wish without needing to download the iPhone app as well). The iOS companion reads information from the watch and provides more insights into the data it displays. Similar to the sleep tracking apps where you use the watch to sleep and track and the iPhone to see the results. When we released the latest version, including both, we changed the price to Free in all countries. After this, we now have a huge problem we haven't been able to solve: Our existing users (who paid for the Apple Watch-only app) cannot download the companion iOS app. If they go to the App Store, it'd just say "Purchased" with no option to download it (nor the "Get" button or the "Cloud" icon). If you go to your App Store account in your iPhone and then to "Purchases," the app won't appear there. Because technically, you never bought it, and it's now free. If you do the same on your Apple Watch, you can still see the app on your purchases, but that would only download the Apple Watch app, not both. But on top of that, I want my users to be able to download the companion app from the App Store with their iPhones because that's what they'll do anyway (only 9% of our app downloads happen straight in an Apple Watch; most come from iPhones). Did anyone have this problem? I'm already talking with support because this is having a very negative impact on our app, and it all looks to be a bug on the App Store or an edge case that Apple hasn't considered. The thing is, I experienced this issue myself with an app from another dev previously where I had the Apple Watch app installed and paid for it. When I wanted to download the companion they released, it was impossible for the same reasons stated above. He managed to fix it, but I couldn't find any information.
Posted
by Ataliano.
Last updated
.
Post not yet marked as solved
0 Replies
310 Views
I'm trying to execute a background task following the Developer Documentation. This is my code import SwiftUI @main struct MyAppTest_Watch_AppApp: App { @Environment(\.scenePhase) var scenePhase let bs = BackgroundSession() @SceneBuilder var body: some Scene { WindowGroup { ContentView() }.backgroundTask(.appRefresh("prova")) { context in print("bg task") await scheduleTask() } .onChange(of: scenePhase) { phase in switch phase { case .active: print("\(#function) REPORTS - App change of scenePhase to ACTIVE") case .inactive: print("\(#function) REPORTS - App change of scenePhase Inactive") case .background: print("\(#function) REPORTS - App change of scenePhase Background") WKApplication.shared() .scheduleBackgroundRefresh( withPreferredDate: Date.init(timeIntervalSinceNow: 5 * 60.0), userInfo: "prova" as NSSecureCoding & NSObjectProtocol, scheduledCompletion: schedule) default: print("\(#function) REPORTS - App change of scenePhase Default") } } } func scheduleTask() async { bs.testSession() await WKApplication.shared() .scheduleBackgroundRefresh( withPreferredDate: Date.init(timeIntervalSinceNow: 5 * 60.0), userInfo: "prova" as NSSecureCoding & NSObjectProtocol, scheduledCompletion: schedule) } func schedule(error: Error?) { if error != nil { // Handle the scheduling error. fatalError("*** An error occurred while scheduling the background refresh task. ***") } print("Scheduled!") } } On the simulator the background refresh occurs correctly according to the preferred date and executes the background task, on the real watch it does not. I also set the app as complication in my watch face. The device I'm testing the app on is an Apple Watch Serie 7 with watchOS 10.3. Any idea?
Posted Last updated
.
Post not yet marked as solved
0 Replies
248 Views
I'm trying to develop a watchOS app with location. I've got the proper privacy settings in the info.plist, similar code works on other devices. (also simulators). But on watchOS simulators everything is grayed out. Privacy & Location -> Location Services App shows up correctly, but everything is grayed out. I've tried: Different simulators (with/without paired iPhone) Different app configurations (Watch-Only app, Watch App with new companion) Toggling Supports Running Without iOS App Installation. It's always grayed out! This is with watchOS 10 simulators across any model, and Xcode 15.2 Any help would be appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
307 Views
I am trying to build my watch app on my series 4 Apple watch currently running WatchOS 10.3 with a deployment target of 10.2 and Xcodes claims that my watch's OS version is too low. I have fully updated my watch to 10.3, tried to downgrade the deployment target to no avail. Xcode doesn't seem to be getting any data on what OS version my watch is running. It says watchOS () in the manage run destinations page. I imagine this is a problem with the connection between my watch and my mac but I cannot solve it. Any advice?
Posted
by Alec a.
Last updated
.
Post not yet marked as solved
2 Replies
526 Views
⌚️Hello, I've noticed in watchOS 10 that when a complication is in the Smart Stack, the value of WCSession.isComplicationEnabled is false. I'm not sure if this is intentional or a bug. It seems trivial at first glance, but it actually affects the communication mechanism mentioned in Implementing Two-Way Communication Using Watch Connectivity. In the following two scenarios, if the user has only added the app's complication to the Smart Stack, then the watch app will not be able to communicate properly with the iOS app. Scenario 1 - WCSession.transferCurrentComplicationUserInfo() // update complications from the iOS app if WCSession.default.isComplicationEnabled { let userInfoTransfer = WCSession.default.transferCurrentComplicationUserInfo(userInfo) // ... } As described in Implementing Two-Way Communication Using Watch Connectivity, when the iOS app proactively updates the data of the watch app, since WCSession.isComplicationEnabled is false, WCSession will refuse to transfer any data. This causes the standalone complication in Smart Stack to not be updated. Scenario 2 - WKApplicationRefreshBackgroundTask When the watch app uses WKApplication.scheduleBackgroundRefresh() to periodically update data, as long as the user has added the app's complication to the watch face, the corresponding WKApplicationRefreshBackgroundTask can be executed periodically in the background to fetch data. However, if the user has only added complication to the Smart Stack, then the watch app will be completely purged, and the background task will not be executed at all. Although WCSession.isComplicationEnabled is not directly used in this scenario, its behavior appears to be the same, that is, the complication in the Smart Stack is not considered a complication by the system. Should I submit a bug report?
Posted
by Gong.
Last updated
.
Post not yet marked as solved
1 Replies
389 Views
My watch APP needs to keep Bluetooth connected with peripherals whether it is in the foreground or background, but the results of my test show that the connection in the background is very unstable, sometimes you can keep the Bluetooth on for a day, but sometimes it will be disconnected 50 times a day, and every time it is disconnected, I will immediately initiate a reconnection, it is certain that there is no problem with the peripheral Bluetooth, because I have another iOS device that has been stably connected to the peripheral, I want to know what causes this instability, and if there is any solution, if someone can provide relevant advice, I will be very grateful
Posted Last updated
.