WatchKit

RSS for tag

Build apps that leverage watchOS features like background tasks, extended runtime sessions, and access to the Digital Crown using WatchKit.

Posts under WatchKit tag

132 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Watch Simulators always shows error "This watch face is not available on this watchOS"
I have created multiple faces, i want to test those on different watch series and watch OS. However i am not able to use simulators for that (iOS and WatchOS). To understand the case please do below steps. From simulator Open Apple watch app and share any face (create your own or share existing) Share via email or airdrop Drag this face into simulator again Error will be shown that face is not available for this device. If try to apply using below code, same error occur CLKWatchFaceLibrary().addWatchFace(at: url) I want to know how can i test my watch faces on different versions using simulators.
1
0
515
Oct ’23
Unable to distribute watchOS only build
I don't see upload option for the App Store connect, can only export .ipa. Also having issues with Transporter, pasting error message here. Could not create a temporary .itmsp package for the app "Redacted.ipa". Unable to determine app platform for 'Undefined' software type. Is anyone else facing the same issue? I am using Xcode 15.
7
1
1k
Oct ’23
How to create our own Watch face to our app?
Are we able to create our own watch face to our application. We have ios app and watch app, need to create watch face with few app data's like heart rate, steps count, etc on the watch face. But I fount some answers like it is not possible to create a watch face. Possible to create watch face for Apple Watch? Are developers allowed to publish watch faces? I have found a website Facer(https://www.facer.io/creator) where they are offering customizing options and generating .watchface from their website. What approach they are following?
1
0
2.3k
Oct ’23
Flutter App with WatchOS - Archive Problem
Hi there, I have a problem archiving a Flutter App containing an Apple WatchOS Target. The WatchOS target is built with the new logic, containing only one app and no Watchkit extension. When I build the app on my iPhone/Simulator everything is working just fine and they can communicate without any problems. The error occurs when I'm trying to upload my built archive to App Store Connect for Testflight testing purposes. It fails with the error Asset validation failed: "Missing Info.plist value. A value for the key “WKApplication“, or “WKWatchKitApp“ if your project has a WatchKit App Extension target, is required in “Runner.app/Watch/MyWatchOSApp Watch App.app“ bundle. For details, see: https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps/setting_up_a_watchos_project". I tried to fix it by adding a info.plist to the WatchOS target, which isn't created initially. By doing so I can not build the Runner App anymore because it fails with "A WatchKit app within this app is not a valid bundle.". Can anyone help me fix it please? Thank you! Greetings
3
1
2.5k
Oct ’23
WatchOS CoreBluetooth maximum peripheral connections
I have an app running on WatchOS. How many BLE peripherals can my app connect to at the same time? If the number of peripheral objects is limited in some way, is the limit imposed on each instance of CBCentralManager? Or is the limit imposed on each app? I have a use case that would require four BLE peripheral connections. Is tis possible? I have another use case that would require 6 BLE peripheral connections. Is this possible?
1
0
399
Oct ’23
Minimum deployment Version for older WatchOSs and newer iOSs.
If a "Minimum Deployment Target" is updated to WatchOS7 on a product(iOS app with a companion watch app) that is already available on the App Store, watches running WatchOS6 will obviously no longer get updates. However, what is the experience for a user who has a WatchOS6 (maybe they own a Series 2) connected to an iPhone with iOS14? Will both the iPhone app and the Watch app stop getting updates? Will the Watch app stop getting updates, but the iPhone app continue receiving them and we have to manage this? Something else? Thanks in advance!
2
0
1.5k
Oct ’23
Can we use Apple Watch sensors all day long with no limit?
I'm student from Korea. I'm interested in apple things. I have several questions about Apple Watch sensors such as ECG(Electrocardiogram), Heart rate, Oxygen Saturation, breath rate, atrial fibrillation(afib) and so on. First of all, Can I use these sensors all day long? with no limit? I'm planning to develop some healthcare application using Apple Watch with sensors. I can't find examples of using sensors 24/7. And Second, If I can use the sensors all day long, can I execute the app in background? Finally, If I can execute the app in background, can I activate the sensors in background? Thank you for your help. I have tried searching developer guide, and searching the GitHub.
1
0
677
Sep ’23
CLLocationManager with watchOS10 not sending anything to didUpdateLocations:
My watch app records workouts including health (with HKWorkoutSession) and location data.The watch app is on the App Store and runs without any problems since long time. I updated my own Watch Ultra to watchOS10 and my app does not properly work anymore. Everything works with the exception that the app does not receive any CLLocationManager data on the physical device. On the simulator it works perfectly. I tried several devices in the simulator and they all work. Also I de-coupled the watch from the phone, deleted the watch completely and re-installed it. My app's target is watchOS9, I tried it with watchOS10 and the problems are the same CLLocationManager has correct and valid permissions CLLocationManager is setup like this: locationManager = CLLocationManager() locationManager.delegate = self locationManager.allowsBackgroundLocationUpdates = true locationManager.activityType = .fitness locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.distanceFilter = kCLDistanceFilterNone locationManager.startUpdatingLocation() CLLocationManager's delegate is listening to: func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) The CLLocationManager is starting and correctly giving feedback on 'didFailWithError' and on 'didChangeAuthorization'. Nothing that tells me that something is wrong and points to a problem. No data is sent to didUpdateLocations. The function is never ever called. Of course I'm outside with my watch and the GPS signal is strong and I wait long enough. My app is adding the recorded workout to Apple Fitness app (my app uses HKWorkoutSession) and even though my own app does not receive any CLLocationManager data, the workout that it sent to Apple Fitness includes all the CLLocationManager data. It really seems like being a problem with my app only. Does someone have an idea or knows of a same problem? Thomas
1
0
700
Sep ’23
Issues with tint color not showing on Multicolor watch faces
I use the widget as a complication. Inside the widget, I have a Label and Image. I use SF symbols for the image. It should be possible to set the image colour in the code. I tried .tint() and .foregroundStyle(). I think my colour should be visible when selecting Multicolor tint varian. How to set an accent colour for an SF symbol inside a widget? Is anyone else having issues with this? My image just renders white on a black background. watchOS 10 Xcode 15 RC
0
0
443
Sep ’23
CLKComplicationWidgetMigrator not working
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?
6
1
1.7k
Sep ’23
Older watch app with extension template, unable to load any saved data from UserDefault watchOS 9 beta 7
Hi all, I am working with an older watch app that still uses the older template that combines the WatchKit App and WatchKit App Extension targets. While trying to migrate the ClockKit complication to the new WidgetKit complication, I cannot get the widget complications to load anything from user defaults. It seems like the widget complications are not using the same user defaults as the watch app though being in the same App Group. I experimented with a new watch app using the new SwiftUI template and the WidgetKit complication was able to load data from user default successfully. Did anyone got WidgetKit complication to load data successfully from user default with the older watch app template? Thanks in advance!
3
0
1.3k
Sep ’23
Has WKExtendedRuntimeSession changed the way timers work in watchOS 10?
I have a stand-alone watchOS app that starts a WKExtendedRuntimeSession and a 1-second repeating timer when a button is pressed. No CPU-intensive stuff happens during this extended (background) time. On watchOS 9, this worked perfectly until I stopped it again (or after the hour I get out of a Mindfulness Session Type has passed, and the extended runtime session expires). The screen could go dark, and the timer would keep running. On watchOS 10, I get about 50 seconds when the screen goes dark, and then the timer just stops. No delegate methods are called (i.e. no "extendedRuntimeSession...willExpire()" or "...didInvalidateWith()" is called), though. Also, the scenePhase does not change at this point, it remains at inactive. The execution just stops. When I tap the watch to turn the screen back on, the timer resumes as if nothing happened. Does anybody know what's going on here? Has something changed in WKExtendedRuntimeSessions in watchOS 10, or is it a bug? I tried removing the timer and changing it to a recursive DispatchAsync.main.asyncAfter block, but it yielded the same result.
1
0
503
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
iOS + WatchOS Build: How to automatize?
Hello, Have an iOS App with (extensionless) Watch App. Watch App is not a stand alone app. Watch App appears in the "Frameworks, Libraries & Embedded content" section of the iOS App Target. Nevertheless, I have to manually launch a build of the Watch App before building the iOS app if I want the build to succeed. Is there a way to automatize build in cascade (at least for release scheme and for "Archiving" ?
1
1
470
Sep ’23
How to Play Audio File on Apple Watch Physical Speaker
I am writing a watchOS app where I have some audio files that I want to play at various points. I am using AVAudioPlayer. It all works in the simulator and it also works if I have Air Pods connected to my watch via Bluetooth. However I get no sound if there isn't a paired set of earphones. In the case of no earphones I would like the sounds to play from the physical watch speaker. I can't seem to find any documentation on how to cause that to happen. Any hints or tips are appreciated.
0
0
574
Sep ’23
Update Watch Complication with CloudKit
I have an iPhone app the uses CloudKit for Core Data syncing. I also have a companion Apple Watch app that syncs to the same CloudKit records. The watch can be used without the iPhone app as well but they both independently sync to the same CloudKit database. This works reasonably well. As soon as either app is opened, the CloudKit will pull down the latest records. I'd like to add a watch complication that shows the state of the CloudKit records. I supported this by adding a Widget extension, embedded in my watch app. The Core Data database in the watch app is part of an app group, so the complication is able to query the same database. So far so good. I'm running into problems with the complication updating after remote records are changed from the iPhone. Here is what is happening: When records are changed on the iPhone, the data syncs to CloudKit but the watch app is not updated when in the background. This is noticed when you open the app and it takes a second for the view to show the new records. Since Core Data database on the watch is not being updated while in the background, the complication is not being updated at all. Part of my confusion is I assumed CloudKit was meant to make this more seamless with silent push notifications? I have the "Remote Notifications" capability enabled on my WatchApp. It seems that only works while the app is in the foreground though. This seems very limiting when you have a complication that depends on the Watch app's Core Data state. I have a few things to work around this with mixed success: "Wake" the watch app explicitly when records are changed on the iPhone app using WatchConnectivityManager. The hope is that by waking the watch app, it will sync with iCloud. This either isn't working or intermittenly works. It is also not clear to me that by activating the watch app, that it will trigger records to sync. I wish there were a way to ask Core Data to sync explicitly. Whenever the Apple watch app wakes in the last step, ask it to WidgetCenter to reload the widget. This process feels convoluted and seems to negate some of the the benefits of CloudKit to synchronize data which I thought would be baked into this process. Any thoughts on a better approach to all this?
3
1
1.2k
Sep ’23
Beginner Seeking Guidance on Connecting a WatchOS App to Tesla API and Core Data Best Practices
Hello everyone, I'm a complete beginner when it comes to programming and have been learning Swift for the past 2-3 months. I'm in the process of writing my very first project, an Apple Watch app for Tesla owners. So far, I've managed to complete the UI aspect of the app and have recently begun diving into the coding part. However, I find myself a bit lost when it comes to connecting my app to the unofficial Tesla API. On top of that, I'm also wondering if integrating Core Data is necessary for this kind of project? If anyone could help me by providing a clear roadmap, it would greatly accelerate my research and learning process. Any tips, tutorials, or resources you could point me toward would be immensely helpful. Thanks in advance for your assistance! Best Regards Sasan
0
0
374
Aug ’23