I just created watchOS app alone a few months ago but I wanted to make a complication extension for my Apple Watch face. Without the aid of existing iOS app
WatchKit
RSS for tagBuild apps that leverage watchOS features like background tasks, extended runtime sessions, and access to the Digital Crown using WatchKit.
Posts under WatchKit tag
134 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
When trying to use the watchOS preview the simulator fails to load and throws about 15 errors. Clearly the simulator is trying to load all of the iOS packages to the watchOS simulator. However, these packages clearly aren't included in the watchOS app. Furthermore, both apps build successfully to the main simulators, just not the previews. Having a list of errors that simply should not be there is a pretty big annoyance when something is going wrong. How do I fix this?
I have two standalone app written for watchos (standalone). One to authenticate and one for connectivity to real-world devices. The connectivity app uses the authentication app before every action, Im testing this with two xcode projects I have created and tried different things ended up with this error.
authapp://authenticate?callback=linkingapp://callback
-[SPApplicationDelegate extensionConnection:openSystemURL:]:2418: URL with scheme "authapp" not supported
how to get the url scheme working? Tested this in simulator and real device. info.plist and AppDelegate files are placed in both apps.
I am developing a watchOS app with a tab view, and inside one of the tabs, I have a 2x2 collection view layout. Each collection item contains a view that handles:
Tap Gesture (.onTapGesture) → Executes an action immediately.
Long Press Gesture (LongPressGesture) → Triggers an update when long press starts and again when it ends.
Drag Gesture (DragGesture) → Updates the position while dragging and resets values when the gesture ends.
Issue:
Most of the time, the gestures work correctly, but if another finger swipes on the screen while a long press is active, sometimes the onEnded event does not trigger, leaving the button in an active state.
Observations:
The onTapGesture executes normally without issues.
The LongPressGesture starts as expected, but if another finger interacts with the screen, the onEnded of the drag gesture does not always trigger.
This results in the button remaining visually or functionally "pressed" until another interaction occurs.
Has anyone encountered similar behavior in watchOS? How can I ensure that long press and drag gestures always complete even when another finger swipes on the screen?
Thanks in advance!
I get a crash in Apple Watch simulator (Series 9 45mm 18.0) as soon as the app launch if I type anything on external keyboard (just hitting command key for instance to capture a screenshot). Same crash on series 7 (45mm, OS 18.1)
But app works normally when I use mouse to interact with the app on simulator.
App does not crash on real device (Watch 4 OS 10.4.1).
Nor does it crash on Series 6 simulator (44 mm OS 17.4).
Here are the log I could collect (apparently, they contain sensitive language !!! so I attach as a file.:
Attached logs
There doesn't seem to be a background mode that will allow an iPhone app to run in the background in order to communicate with its watch app, which is running in the foreground on the watch. Have I missed something?
Related but not quite the same: say the iPhone app can run in the background to get location updates. But it only wants to do so when the watch app is running. Is there a way that the watch app can wake, or even start, the iPhone app, and for the iPhone app to then enable location updates?
(I have previously implemented Bluetooth background modes - I think I could achieve both of the above if I had the watch and the iPhone communicate using my own BTLE protocol, rather than using Watch Connectivity. Is this true?)
I've got a watch app, still with storyboard, WKInterfaceController and WatchConnectivity.
After updating it for swift 6 concurrency I thought I'd keep it for a little while without swift 6 concurrency dynamic runtime check.
So I added -disable-dynamic-actor-isolation in OTHER_SWIFT_FLAGS, but it doesn't seem to have an effect for the Apple Watch target. Without manually marking callbacks where needed with @Sendable in dynamic checks seem to be in place.
swiftc invocation is as (includes -disable-dynamic-actor-isolation):
swiftc -module-name GeoCameraWatchApp -Onone -enforce-exclusivity\=checked ... GeoCameraWatchApp.SwiftFileList -DDEBUG -enable-bridging-pch -disable-dynamic-actor-isolation -D DEBUG -enable-experimental-feature DebugDescriptionMacro -sdk /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS11.2.sdk -target arm64_32-apple-watchos7.0 -g -module-cache-path /Users/stand/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/stand/Library/Developer/Xcode/DerivedData/speedo-almhjmryctkitceaufvkvhkkfvdw/Index.noindex/DataStore -enable-experimental-feature OpaqueTypeErasure -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -swift-version 6
...
-disable-dynamic-actor-isolation flag seems to be working for the iOS targets, I believe.
The flag is described here
Am I missing something? Should the flag work for both iOS and Apple Watch targets?
Hi all,
I’m developing a watchOS app that uses a WebSocket API to process voice audio. However, I keep encountering this error when trying to establish the connection:
nw_endpoint_flow_failed_with_error [C1 <server URL>:443 failed parent-flow (unsatisfied (Path was denied by NECP policy), interface: ipsec2, ipv4, ipv6, proxy)] already failing, returning
I’ve read Technical Note TN3135, which outlines an exception for audio streaming apps. My app is an audio streaming app, and I’ve already added background audio mode to the app’s capabilities. However, I’m not sure what else is required to meet the exception described in TN3135.
Questions
How do I meet the exception outlined in TN3135 for WebSocket audio streaming on watchOS?
Does NECP enforce additional restrictions even with background audio enabled, and how can I address this?
Any guidance or examples of implementing WebSocket audio streaming on watchOS would be greatly appreciated.
Thanks!
Hi all. Does anyone know if there's a way to get a list of watch faces for a paired Apple Watch or to set the current face? Or is this just not allowed?
I've taken a look at the WatchOS, WatchKit, and WatchConnectivity documentation and no luck there.
Hi everyone. Does anyone know if there a way to get a list of watch faces for a paired Apple Watch, or to set the current watch face? Or is this just not allowed?
Have looked through the WatchKit, WatchConnectivity, and WatchOS documentation and haven't found anything.
So I'm trying to use SpriteKit to make the background of my game. The walls have alpha 1.0, and the safe area alpha 0 and fully transparent. (e.g. a big black square with a smaller transparent square in the middle of it). Yet sprite kit always assume the entire image is either fully opaque or fully transparent. That defies its purpose isn't it? Is there a way to make this work?
Our watch app, Regatta Timer, is a specialised countdown timer for sailing competitions. It is crucial that the beeps & haptics continue when 'wrist down' on alway on displays. We tried to enable this by adding 'background mode' but that only works in the Xcode Apple Watch simulator, not on an actual device with always on display. Any idea how we can get this working also on the Apple Watch device?
In ContentView.swift we currently added this code:
WKInterfaceDevice.current().play(sound)
}
but that doesnt work - regardless of adding , phase == .active`
or not.
STEPS TO REPRODUCE
Install on an ACTUAL DEVICE with always on display
start the countdown timer: beeps & sounds are OK (each minute,...)
do 'wrist down': the countdown timer continues on the dimmed display, but the sounds & haptics stop working until you raise your wrist to wake up the display.
I have a depended watch app bundled with my iOS app.
// ...
<key>WKRunsIndependentlyOfCompanionApp</key>
<false/>
// ...
My code:
guard WCSession.isSupported() else {
return
}
let session = WCSession.default
session.delegate = self
session.activate()
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
// ...
if (session.activationState == .activated) {
let log = Log(isPaired: session.isPaired, isWatchAppInstalled: session.isWatchAppInstalled)
uploadLogToServer(log)
}
// ...
}
and also:
guard WCSession.isSupported() else {
return
}
let session = WCSession.default
guard session.activationState == .activated, session.isWatchAppInstalled else {
return
}
do {
try session.updateApplicationContext(...)
} catch {
uploadErrorToServer(error)
}
What I've observed is that when I query the logs in the server's database, I get entities with isPaired = false and isWatchAppInstalled = true.
Also, when I query the errors I see deviceNotPaired errors.
So my question is, does Should WCSession.isPaired property be true before accessing WCSession.isWatchAppInstalled property ?
Hello, since an update in September, the alarm widget on the watch face no longer counts down accurately like it used to.
This is extremely frustrating for me because I used it for work so I have know exactly how much time I had in a particular circumstance.
So for example, say I have an alarm set for 12:30. Before the update in September, I was able to look at my watch and know immediately that I had 24 minutes before the alarm, or look again and know it was the. 10 minutes before the alarm.
Now, if I look at the watch face, it will say I have 24 minutes before the alarm, but it may actually only be 10 minutes before the alarm.
I understand for some people this may be trivial, but it is really disappointing for me, and renders one of the most useful features of the Apple Watch useless to me now.
I am hoping this is just an oversight during an update, so looking to see if this is something that is currently being worked on?
I just installed beta 11.3 and still having the same issue.
Now, if I press and hold on the watch face, like I’m going to change watch faces, then click out of it. It does update it. But it is not the same as it used to be.
Thank you
Whenever I try to build on my Apple Watch using Xcode, I often encounter connection issues. It typically takes about an hour of troubleshooting, including restarting devices, restarting Xcode, erasing the Apple Watch, and other steps. I was wondering if anyone else has experienced similar problems and if there are any effective solutions.
I have an iOS app, watchOS app, and iOS Widget that shows the most recent data in the database.
The watch app sends data to the iOS app over the WCSession and is received in session(didReceiveMessage, replyHandler). After that data is processed, reloadAllTimelines() is called.
When running in Simulator or on device plugged in to debugger, it works, the widget updates when the app is closed (in background, even if force quit).
But when running TestFlight or App Store build, the data is still processed and saved to Core Data (I open the app and it's there), but the widget doesn't update.
It seems that reloadAllTimelines only works when the app is in foreground (at least in non debug builds). I dont have an iOS 17 device to check but I think this is a recent bug with iOS 18.
When launching the SimpleWatchConnectivity sample in a simulator (iOS 18.2 + watchOS 11.2), almost all the functionality works, but TransferFile does not work. The error is the following:
-[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer <WCSessionFileTransfer: ...> due to Error Domain=NSCocoaErrorDomain Code=4866 "Caught exception during archival: This object may only be encoded by an NSXPCCoder."
How can it be fixed or worked around?
I'm encountering an issue with HealthKit permissions and would appreciate some guidance:
In my app's previous version, I granted write permissions for HKObjectType.workoutType() via the WatchKitExtension. Now, in the upcoming version, I'm trying to request read permissions for both HKObjectType.workoutType() and HKSeriesType.workoutRoute() via the iOS app.
However, after granting access:
The read permissions for Workout and Workout Route don't show up under Settings -> Health -> Data and Access -> [My App].
The Workout Route permission status remains notDetermined, even though I selected "Allow" when prompted.
Interestingly, if I request the same permissions via the WatchKitExtension, everything works as expected, and the issue doesn't occur.
Has anyone experienced a similar issue or have insights into why this might be happening? Could it be related to requesting permissions from the iOS app instead of the WatchKitExtension?
I'm encountering an issue with HealthKit permissions and would appreciate some guidance:
In my app's previous version, I granted write permissions for HKObjectType.workoutType() via the WatchKitExtension. Now, in the upcoming version, I'm trying to request read permissions for both HKObjectType.workoutType() and HKSeriesType.workoutRoute() via the iOS app.
However, after granting access:
The read permissions for Workout and Workout Route don't show up under Settings -> Health -> Data and Access -> [My App].
The Workout Route permission status remains notDetermined, even though I selected "Allow" when prompted.
Interestingly, if I request the same permissions via the WatchKitExtension, everything works as expected, and the issue doesn't occur.
Has anyone experienced a similar issue or have insights into why this might be happening? Could it be related to requesting permissions from the iOS app instead of the WatchKitExtension?
support destinations have no Apple Watch, I tried delete the watch App target and recreate watch App for Existing app, but if is unuseful