I get this error with xcode 16.1 uploading to app store:
Asset validation failed
Invalid Info.plist key. The key 'UIBackgroundModes' in bundle new3bmeteo.app/Watch/new3bmeteowatch.app/PlugIns/new3bmeteowatch Extension.appex is invalid. (ID: a1e48ae9-5b51-4252-99e7-116b6359cb39)
info.plist:
// some other things
UIBackgroundModes
location
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
132 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi,
I'm making a WatchKit game app with SpriteKit and Objective-C, and I'm encountering an annoyance where system gestures, namely long-pressing the top and bottom edges to pull Notification/Control Center, interfere with the controls of the game.
In iOS, this can be mitigated by using overriding preferredScreenEdgesDeferringSystemGestures in UIViewController, but I couldn't find any equivalent API in any WatchKit class, and searching for similar symbols only yielded a single private API (-[_UISystemAppearanceManager screenEdgesDeferringSystemGestures]) that isn't ever called on watchOS.
Any idea how to achieve a similar effect on watchOS?
Our company has developed a product available, which measures body composition. During the measurement process, lasting 40 seconds, we require the device screen to remain illuminated. We are actively using the "Always On" feature and have set the timer on the watch to 70 minutes to prevent the screen from dimming.
However, we are encountering issues where the screen may still turn off during the measurement. Could you please provide guidance on how to keep the screen active with backlighting across all Apple Watch models during measurements?
On iPhone, we can use iBeacon to wake up the APP in the background for Bluetooth scanning connection, now we want to port the function to AppleWatch APP, but the API related to iBeacon is not applicable on watchOS, does watchOS have a similar wake up mechanism?
I have an app that uses Storyboard (not SwiftUI). Is there a way to define that a particular WKInterfaceButton should receive the "sent action" (as if the user tapped the button on screen) when the user uses the double-tap gesture with their fingers?
I have an iOS and watchOS app where both can run independently, I am not using WatchConnectivity to send data back and fourth. The issue I'm having is that if I schedule a local notification on the watch and the phone is unlocked, it will not show on the watch for about 10-15 seconds. If I uninstall the iOS app or have the phone locked, it will show immediately on the watch.
To my understanding, this is somewhat the expected functionality but is there a way to bypass it? My app is a timer app and it really should not have a delay.
WatchOS app is running in the foreground and can wake up the iOS app, but it can't trigger didReceiveMessage in the iOS app.
iOS and Watch apps in the foreground can communicate with each other without any issues. However, when my app is closed, even though it wakes up, it cannot communicate. Any ideas? Should I be using a background task ios app side?
I'm using Text(date, style: .timer) to display a timer in a WatchOS widget, which works great. The problem is that when the watchface goes dim the time goes from showing the time as "MM:SS" to showing "M minutes". Why is this occuring and how can I change the behavior? I understand it needs to remove seconds to preseve battery life, but why it is putting the word "minutes" at the end, this is messing up my layout. Thanks.
Dear all,
i am a music conductor and developer, and to fulfill my joy with music i recently developed a WatchFace and some apps for a non-apple watch called "PineTime".
My whole development is done in c++ and is available at
https://github.com/luto65/PineConductor/
Since I am aswell an apple developer, and most of my friends have apple watches, i am now porting those c++ apps to the apple watch.
I just finished the very first one, that is actually a watch Face
I now ported it to appleWatch and it looks pretty similar too (here a screenshot from the simulator)
I would like to now remove the annoying digital hour on the top right corner, and then sell it as new custom face, together with my other swift-ports of my original c++ applications.
Looking forward any feedback.
Can you initiate a live activity from a Watch app? From what I can tell you can only do it from an iOS app and then have the Watch mirror it, is that true?
If you were builiding a standalone timer app for WatchOS for instance and wanted the timer to show up automatically in Smart Stacks when the app is in the background, is this possible?
Thanks
Hi,
working on customising my live activity Smart Stack layout for ios18.
A thing that is very frustrating is that I consistently looks different for me in the Xcode preview and on the actual watch.
See attached screenshots below.
The sizes are different, and italic doesn't work on the watch, for example.
It makes it time-consuming and unpredictable, so I was wondering if this is a known issue or if I'm doing something wrong, and also can I do anything?
thanks
edit: this is the layout:
var body: some View {
VStack(alignment: .center, spacing:4) {
HStack(alignment: .center) {
IconView(resource: "n-compact-w", bgColor: Color.checkedIn, padding: 2, paddingRight: 6, paddingBottom: 6)
.frame(maxWidth: 25, maxHeight: 25).aspectRatio(1, contentMode: .fit)
Text("Checked Out")
.font(.title3).bold()
}
Text(status.loc)
.font(.headline)
.multilineTextAlignment(.center)
Text(FormatUtils.getFormattedDateTime(status.time)).font(.subheadline)
.multilineTextAlignment(.center).italic()
}
}
I am trying to parse CMSensorDataList in watchOS. The maximum batch of data is comprised of 30 minutes. The sampling rate is 50Hz, which makes it 90,000 records for 30 minutes. We iterate over each item and finally write the data to a CSV file. As this is a slow processing keeping in view the execution limits of watchOS, the process suspends when app goes to the background. This way, it takes too much time to parse a significant time data. My question is, is there a way we can serialize this CMSensorDataList as a whole and transfer it to the phone using WCSession? Or is there another effective way to achieve this?
Hello, I am updating my live activity for the new ios18 Smart Stack functionality.
I got it working through the WWDC session (Bring your live activities to Apple watch).
I'm doing
supplementalActivityFamilies([.small])
and then a custom layout in the .small ActivityFamily
However, any images I try to use in the Smart Stack just show up as grey squares. (it works on the phone live activity)
I suspect it's because my app images are not moved over to the watch? Because I don't have a watch app and such no watch target?
If anyone can help me understand if there's anything I can do in order to have a custom image show up on the smart stack, I'd be very grateful.
Hello everyone!
I want to add hand gesture controls to my Apple Watch app. Specifically, I’m looking to implement the following gestures:
1. Tapping index finger and thumb together once
2. Tapping index finger and thumb together twice
3. Fist clench
4. Double fist clench
Each gesture should trigger a different action within the app.
However, I can’t find any information on how to implement this. I only came across an example using .handGestureShortcut(.primaryAction) (Enabling the double-tap gesture on Apple Watch https://developer.apple.com/documentation/watchOS-Apps/enabling-double-tap), but I need to handle four distinct gestures.
Is this possible in watchOS 11? Any guidance or examples would be greatly appreciated!
Thank you!
I'm scheduling local notifications on my WatchOS app, but they are always alerting exactly 13 seconds later than scheduled. I have read other users having the exact same issue but there is no solution anywhere. I'm not sure how one is supposed to write any sort of timer app when they are always coming in delayed. Any idea why this occurs and how to resolve it? For now I am subtracting 13 seconds from the end time, but that's not really a solution I'm happy with.
Thanks
I'm using Live Activity features in my app, but I want to customize the user experience across different Apple devices. Specifically, I'd like to:
Keep Live Activity enabled and functioning on the iPhone Disable or prevent Live Activity from appearing on the connected Apple Watch
Is this level of device-specific control possible with Live Activity? If so, what's the best approach to implement this functionality? What I've tried:
I've looked through Apple's documentation on Live Activity, but couldn't find specific information about device-level control. I've experimented with ActivityKit, but haven't found a clear way to distinguish between iPhone and Apple Watch when pushing updates.
Hi,
I created an iOS app compatible watchOS app which was running perfectly fine before I updated my Xcode to use iPhone16. But after updating, I started to get kclErrorDomain error: 1 and I am not sure why is it happening after update.
I am trying to use coreLocation module as-
import Foundation
import CoreLocation
import Combine
class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate {
private var locationManager = CLLocationManager()
@Published var location: CLLocation?
override init() {
super.init()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestWhenInUseAuthorization()
locationManager.startUpdatingLocation()
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
if let location = locations.last {
self.location = location
print("Updated location: \(location.coordinate.latitude), \(location.coordinate.longitude)")
} else {
print("No locations received")
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
print("Failed to find user's location: \(error.localizedDescription)")
}
}
and I am trying to use it as-
@StateObject private var locationManager = LocationManager()
guard let currentLocation = locationManager.location else {
signInError = "Location not available"
isLoading = false
return
}
let latitude = currentLocation.coordinate.latitude
let longitude = currentLocation.coordinate.longitude
sendToBackend(email: email, password: password, deviceName: deviceName, deviceModel: deviceModel, deviceIdentifier: deviceIdentifier, latitude: latitude, longitude: longitude)
Can someone help me regarding this?
The TextField Shows and When selected opens the keyboard very slowly and before entering text closes immediately with these messages.
<PUICQuickboardController: 0x6000029111f0> [0x6000029111f0-1] presentation watchdog expired!
<PUICQuickboardController: 0x6000029111f0> [0x6000029111f0-1] is no longer the current presentation, we must have timed out...
This App was working fine in Simulator and test devices until recently.
I have a simple wrapper class around WCSession to allow for easier unit testing. I'm trying to update it to Swift 6 concurrency standards, but running into some issues. One of them is in the sendMessage function (docs here
It takes [String: Any] as a param, and returns them as the reply. Here's my code that calls this:
@discardableResult
public func sendMessage(_ message: [String: Any]) async throws -> [String: Any] {
return try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<[String: Any], Error>) in
wcSession.sendMessage(message) { response in
continuation.resume(returning: response) // ERROR HERE
} errorHandler: { error in
continuation.resume(throwing: error)
}
}
}
However, I get this error:
Sending 'response' risks causing data races; this is an error in the Swift 6 language mode
Which I think is because Any is not Sendable. I tried casting [String: Any] to [String: any Sendable] but then it says:
Conditional cast from '[String : Any]' to '[String : any Sendable]' always succeeds
Any ideas on how to get this to work?
I’ve developed an Apple Watch extension for an existing iOS app. When I run the app on the watch via Xcode using the simulator, everything works fine. However, when I try to install it on my iPhone, the Watch app doesn’t show it in the "Available Apps" list, so I can't install it on the watch.
The Apple Watch is connected to my iPhone, and I can see other apps available for installation without any issues.
I also created a brand new project with watchOS support to troubleshoot, but the same problem occurred.
Any ideas on how to resolve this?