WatchKit

RSS for tag

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

WatchKit Documentation

Posts under WatchKit tag

134 Posts
Sort by:
Post marked as solved
4 Replies
1.2k Views
Hello, So I made a VERY simple watch app that basically tracks drinks for a project. I was going to go with complications, but they seem to be outdated. Lo and behold Widgetkit! I set up a VERY simple widget that shows the drink count in my app, and it works AMAZINGLY well in Xcode using the WidgetCenter.shared.reloadAllTimelines() function. However, on actual hardware, the widget will only update to the new drink count if I lock and unlock the watch. It does update overtime in accordance to the widget timeline, but I'd rather it update while the user is in app (no update budget used) and in real time, so the user doesn't see their drink count from 2 minutes ago after they've already added a drink. Keep in mind this is a WatchOS app, there is no iOS app it's attached to. Is there anyway I can refresh or re-render the widget like how the Lock/unlock watch does? Anyone else having this issue? I see a few options, but they involve creating an iOS app with background enabled.. I'd like to keep this simple and a watchOS app. Thank you
Posted
by
Wk7
Post not yet marked as solved
2 Replies
1.4k Views
I’ve created a single-target watchOS app in Xcode 14, but I can’t seem to get ClockKit complications working. I’ve added a CLKComplicationDataSource class to my watch target, and in the Info pane for my target I have set the CLKComplicationPrincipalClass key to MODULE-NAME.ComplicationController I haven’t yet added Complication placeholder images to my Assets.xcassets, but as far as I am aware, that shouldn’t be a problem while I am still testing. However, when I run it on a watchOS simulator, the complications never show up on the watch complications list when adding a complication. All of the tutorials I can find for ClockKit complications reference older two-target WatchKit apps. Do the newer single target apps no longer support ClockKit? If so, how can I make a two-target WatchKit app with Xcode 14? Unfortunately I cannot use WidgetKit for my complications because I need to support watchOS 7 at least, and WidgetKit only supports watchOS 9+ Thanks for your help
Posted
by
Post not yet marked as solved
2 Replies
1.3k Views
I have tried several times to restart all the devices or turn off turn on developer mode, but continuing getting "waiting for first unlock" in Xcode. The Xcode version is 14.2 with ios 16.0. I tried to work with the older version of iOS 15 and Xcode13, but it failed with "new watch new ios version at 16.0". Does anyone know how can I get this working? Thanks
Posted
by
Post not yet marked as solved
2 Replies
1.1k Views
I am trying to add a watch extension to my existing iOS app. I added a new watch target and I see the new single watch app folder (no extension folder anymore). I also added the watch target as a dependency (embedded content / target dependency) to my app target. I also made sure the bundle identifier of the watch target matches the apps identifier + .watchkitapp But when I try to archive the app and choose validate, I get the error that the watch info.plist is missing the WKWatchKitApp property. So I add it via the Info tab on the watch target. (Which creates a new info.plist file that only contains this single property) When I try again, the build fails with this: Error (Xcode): WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit. So I add <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.watchkit</string> </dict> to the watch info.plist but the build error remains. I am a bit lost here, as all questions and tutorials refer to the old Xcode style.
Posted
by
Post not yet marked as solved
1 Replies
957 Views
We're currently trying to develop an Apple Watch companion app for our iOS app using the new WatchOS 9 which has the VoIP call capabilities. Is there a way to mirror VoIP notifications similarly to push notifications between the WatchOS app and iOS app? Essentially we'd like to be able to send a VoIP notification to the iOS app and have the answer/decline call screen show up in both the iPhone and Apple Watch. Currently when we send a VoIP notification to the iOS app, the Apple Watch does not receive anything. Push notifications and local notifications work just fine.
Posted
by
Post marked as solved
3 Replies
1.1k Views
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?
Posted
by
Post not yet marked as solved
0 Replies
569 Views
Watch Standalone App The icon is not displayed in the Watch app on iPhone. We are currently trying to get the Apple Watch Standalone app to be judged. It has been rejected in the current review. The cause is that after installing the app on the watch, the app icon is displayed as a blank image in the "Installed on Apple Watch" item of the "Watch" app, which is the default app of the iPhone. The app icon installed on the watch cannot be displayed in the iPhone's default "Watch" app. If anyone knows of a possible way, please let us know. I've tried a lot of different ways now, but to no avail. Even if I combined the iPhone + watch icon in Watch Assets and installed the watch app, it failed. Even the Apple guidelines given by the reviewer have no relevant information at all.
Posted
by
Post not yet marked as solved
1 Replies
726 Views
Is it possible to share data between multiple Watches paired to the same iphone? Background: We are developing an app that collects sensor data from Apple Watch and uploads it to the cloud via iphone. Problem: We aim to upload sensor data files from all Apple Watches to the cloud, even when multiple watches are paired to a single iPhone. However, in reality, only the files from the currently active Watch are sent. If we could share data among multiple Watches, we could solve this problem. Please let me know if you have any other good solutions.
Posted
by
Post not yet marked as solved
1 Replies
815 Views
Hi, Why I cannot see 'Include Complication' option when I am trying to create a new watch app project in xcode?
Posted
by
Post not yet marked as solved
1 Replies
725 Views
Hello, I tried to use the new underwaterDepthPrompt and underwaterDepthCriticalPrompt with WKInterfaceDevice.current().play(_:) without any success on my A2157/WatchOS 9.5.1 (others are working perfectly). Is it normal?
Posted
by
Post not yet marked as solved
0 Replies
471 Views
Hi there, I'm trying to figure out how to make my app always on top when waking the apple watch, just like the native Workout app does. I've noticed the official guidance for users to enable this behavior, but how can I introduce it into my own app? Any answers will be appreciated! Reference to apple support: https://support.apple.com/en-sg/guide/watch/apd748b87e2a/watchos -> Wake to your last activity
Posted
by
Post not yet marked as solved
1 Replies
726 Views
I want to create interactive watch face widget in a way, so user can see some data from my app on the Watch Face widget and then tap on the widget (complication) to change the data without moving inside the app. Does it possible? Or after the tap user always will be moved inside my app? I saw interactive widgets was introduced for iOS and macOS on WWDC23 https://developer.apple.com/videos/play/wwdc2023/10028. But can smth like that be developed for WatchOS?
Posted
by
Post not yet marked as solved
0 Replies
311 Views
When will the Watch be able to monitor blood pressure?
Posted
by
Post not yet marked as solved
1 Replies
1k Views
Isn't it possible to use the same widgetkit extension for both iOS and WatchOS? In the WWDC's BackyarBirds project from Apple, I can see the widget extension is added to both the multiplatform (including iOS) and the watch targets. I can also see that the SwiftUI code even uses macros to check which platform the code is running on. However, I'm having several issues with adding the same extension to both targets. When I add it to the watch target, I get a build error that I'm trying to embed an application that also builds for iOS and that is not allowed for the watch app. Not sure if any code here is helpful, but this is my widget UI code: struct AkvaWidget: Widget { private let kind = "Akva Widget" var families: [WidgetFamily] { #if os(iOS) return [.accessoryCircular, .accessoryRectangular, .systemSmall] #elseif os(watchOS) return [.accessoryCircular, .accessoryRectangular, .accessoryInline, .accessoryCorner] #endif } var body: some WidgetConfiguration { StaticConfiguration( kind: kind, provider: AkvaSnapshotTimelineProvider() ) { entry in AkvaWidgetView(entry: entry) } .configurationDisplayName("Akva") .description("Keep track of your water intake.") .supportedFamilies(families) } }
Posted
by
Post not yet marked as solved
0 Replies
766 Views
Anyone who has successfully migrated to using WidgetKit for their Apple Watch complications, your help would be greatly appreciated! I've migrated to WidgetKit for my Watch app. On the Apple Watch Face Editor, the new Widget names and options appear correctly. However, on the iPhone Apple Watch app, it offers both WidgetKit and old ClockKit complications... this should not be. I also have found rendering issues where Watch Faces on the main My Watch tab have blank gaps for WidgetKit complications, when selecting the Watch Face they then render (see photos) I've put in a feedback FB12460375 Have tried a full clear and reinstall of my app on both devices, no change. This issue occurs on WatchOS 9.5.2 / iOS 16.5.1 and WatchOS 10 Beta 2 / iOS 17 Beta 2 Any other ideas?
Posted
by
Post not yet marked as solved
0 Replies
492 Views
Hello and good luck. I am a watchOS application developer. When watchOS was updated to 9.5.2, I used Xcode14.3.1 to report an error during real-device debugging. This troubled me a lot. Please help me to find out what caused it. I have already Upload the error message, which really delays my application development progress. XcodeError
Posted
by
Post not yet marked as solved
0 Replies
670 Views
My App includes iPhone + Watch. Then, I carried out the app transfer, After app transfer, I could only see the bundle ID for iphone, but could not find the bundle ID for watch. So I tried to recreate the missing watch bundle id and got an error: An App ID with Identifier 'com.***.watchkitapp' is not available.Please enter a different string. I guess the Bundle ID is duplicate, so I created a non-duplicate Bundle ID to develop, it is ‘com.***.watchapp’, by the way, I want to migrate to SwiftUI. When I finished the development and uploaded the new ipa, I got another error: Invalid Bundle Identifier. Attempting to change bundle identifier from com.***.watchkitapp to com.***.watchapp is disallowed for bundle *** Watch App.app I can't do anything now. What am I supposed to do
Posted
by