Apple Watch

RSS for tag

Discuss hardware-specific topics related to Apple Watch.

Apple Watch Documentation

Posts under Apple Watch tag

120 Posts
Sort by:
Post not yet marked as solved
1 Replies
706 Views
My codes : CLKWatchFaceLibrary().addWatchFace(at: url) { (error) in print(error) } I can add other watch faces except Memoji watch face. The error is Error Domain=CLKWatchFaceLibraryErrorDomain Code=4 "IMPORT_FACE_ERROR_FACE_NOT_AVAILABLE" UserInfo={NSLocalizedDescription=IMPORT_FACE_ERROR_FACE_NOT_AVAILABLE}
Posted
by
Post marked as solved
1 Replies
763 Views
I am pretty new to Swift development and I am currently developing my first project where I calculate the stress level of a person using the Heart Rate Variability samples from HealthKit. I finished the iOS app where I request all HRV samples from the past 120 days, this works perfectly. But when I try to do the same in my Apple Watch project, I am only able to retrieve data from the past 8 days. This seems weird to me, since the data is recorded on the Apple Watch itself and HealthKit has a shared database. I am wondering if HealthKit just limits the predicates to 8 days for HR data on the Apple Watch or if this might be a problem with my Apple Watch? Thanks in advance.
Posted
by
Post not yet marked as solved
1 Replies
643 Views
When I run my watchOS app on a real device, It prints this in the console: watchOS Extension[313:21609] [BTAudioSession] Activate failed: kParamErr (### BTSmartRoutingDaemon not running) watchOS Extension[313:21609] [BTAudioSession] Error: kParamErr (### BTSmartRoutingDaemon not running) What is this BTAudioSession and BTSmartRoutingDaemon? There's nothing available with this name on Apple Developer Documentation neither somewhere on the internet. Note: I am not using any third party frameworks.
Posted
by
Post not yet marked as solved
6 Replies
796 Views
I am unable to install my watch app on my Apple Watch via Xcode. There is no code change from my end and this issue just happened recently. My Apple Watch is running on watchOS 7.3. This is the error log I received whenever I tried to build my watchOS app. Details Unable to install "xxxxx Watch App" Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402652944- The version of WatchKit used by this app is no longer supported on this version of watchOS. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402652944 User Info: { 		DVTRadarComponentKey = 261622; 		MobileDeviceErrorCode = "(0xE80000F0)"; 		"com.apple.dtdevicekit.stacktrace" = ( 0	 DTDeviceKitBase										 0x000000012e633c8f DTDKCreateNSErrorFromAMDErrorCode + 220 1	 DTDeviceKitBase										 0x000000012e672241 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155 2	 DVTFoundation											 0x000000010b53e64b DVTInvokeWithStrongOwnership + 71 3	 DTDeviceKitBase										 0x000000012e671f82 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440 4	 IDEiOSSupportCore									 0x000000012e4e2a10 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513 5	 DVTFoundation											 0x000000010b66d17e DVT_CALLING_CLIENT_BLOCK + 7 6	 DVTFoundation											 0x000000010b66eda0 __DVTDispatchAsync_block_invoke + 1191 7	 libdispatch.dylib									 0x00007fff2018b5dd _dispatch_call_block_and_release + 12 8	 libdispatch.dylib									 0x00007fff2018c7c7 _dispatch_client_callout + 8 9	 libdispatch.dylib									 0x00007fff201925fe _dispatch_lane_serial_drain + 606 10	libdispatch.dylib									 0x00007fff201930cb _dispatch_lane_invoke + 375 11	libdispatch.dylib									 0x00007fff2019cc5d _dispatch_workloop_worker_thread + 819 12	libsystem_pthread.dylib						 0x00007fff20334499 _pthread_wqthread + 314 13	libsystem_pthread.dylib						 0x00007fff20333467 start_wqthread + 15 ); }- System Information macOS Version 11.2 (Build 20D64) Xcode 12.4 (17801) (Build 12D4e) Timestamp: 2021-02-04T00:36:31+08:00 Things I have tried: Upgrading/downgrading Xcode (version 12.2, 12.3, 12.4 and 12.5 beta) Deleting "Derived Data" folders Unpairing/Pairing my Apple Watch Cleaning the project and restarting XCode Any help would be greatly appreciated. Thank you!
Posted
by
Post not yet marked as solved
5 Replies
984 Views
I updated the Apple Watch 3 to the latest os and now I am not able to run my independent watchos app on it. See as it happens with every release they forget to put the symbols file. https://developer.apple.com/forums/thread/664613 https://developer.apple.com/forums/thread/656601 https://developer.apple.com/forums/thread/663557 Is there anyone else also facing this work? Also, what's the workaround. I saw that if you have symbols for previous versions you can tweak it or something but I don't have anything as this would be the first time I would be running the watchos app. Any other advice where I can reach out to?
Posted
by
Post not yet marked as solved
2 Replies
768 Views
Hello everyone. I'm trying to work with Core Motion, getting readings from my Apple Watch (Series 4), but am getting inconsistent behaviour. If I run the code from Apple's Core Motion documentation - https://developer.apple.com/documentation/coremotion/getting_processed_device-motion_data (see Listing 1), I don't get any readings. The code I run, which works fine on iPhone, but not on Apple Watch, is: func startDeviceMotion() { if motion.isDeviceMotionAvailable { self.motion.deviceMotionUpdateInterval = 1.0 / 60.0 self.motion.showsDeviceMovementDisplay = true self.motion.startDeviceMotionUpdates(using: .xMagneticNorthZVertical) self.timer = Timer(fire: Date(), interval: (1.0 / 60.0), repeats: true, block: { (timer) in if let data = self.motion.deviceMotion { let x = data.attitude.pitch let y = data.attitude.roll let z = data.attitude.yaw } }) RunLoop.current.add(self.timer!, forMode: RunLoop.Mode.default) } } The problem is that although .isDeviceMotionAvailable returns true and runs the if statement correctly, the returned data from self.motion.deviceMotion only gives me nil's. I.e. DeviceMotion is available but still returns nil. What I have tried so far without luck, is: Adding various Accelerometer, Gyroscope, Location, and Privacy entries to my Info.plist Modifying the code: lowered the update interval checking for returned errors from the closure running it on a different thread Searched online for example projects, StackOverflow, etc., but without luck Run the code as an iPhone app. Here it works as expected without issues. I'm fairly new to this forum and Apple Development, so any help would be much appreciated!
Posted
by
Post not yet marked as solved
4 Replies
1.1k Views
Hi, I work in a fintech company that offers support to Apple Pay in our cards, i.e. our users have the option add their cards to Apple Pay using our app (in-app provisioning). Our company already got the proper In-App provisioning entitlements from Apple and the entire in-app provisioning process is working as expected. When an user taps on the button "Add to Apple Wallet" in our app to provision his card, we call the following code below: let config = PKAddPaymentPassRequestConfiguration() config.cardholderName = "\(firstName) \(lastName)" config.localizedDescription = "MyApp Card" config.primaryAccountSuffix = String(cardSuffix) config.paymentNetwork = .visa /* Present the Apple Pay ViewController */ let controller = PKAddPaymentPassViewController(requestConfiguration: config, delegate: self) UIApplication.shared.delegate?.window??.rootViewController?.present(controller!, animated: true) If the user has an Apple Watch paired, he is greeted with a screen asking him to select on which device he wants to add the card: on his iPhone or on the Apple Watch (please see the following screenshot: imgur.com/a/MSQPnt8 - After the user selects the device, the provisioning process continues successfully as expected. However, if the user taps on the "Add to Apple Wallet" button and he already has the card added to one of the devices (the Apple Watch, for example), then the code above is called again, but he is once again greeted with the same screen asking him to select on which devices he wants to add the card, on his iPhone or on his Apple Watch, even though the card is already added on the Apple Watch. The way I understand it, since the card is already added on the Apple Watch, only iPhone should appear as a valid option to have the card added. Is there anything else that I need to do in the code above to make sure only the available devices (I mean, only the devices that don't have the card added on Apple Pay yet) are listed in the device selection? Thanks
Posted
by
Post not yet marked as solved
1 Replies
428 Views
Hi guys! I found a bug on Apple Watch that could be performed on any watch devices. but I don’t know where to write it. When I communicated with official store they said that they don’t provide this information further. So, if you switch time on your iPhone a day forward and then go back to normal time, you will see a collapse with columns in Activity kit. Everything else will be fine, so those columns are not corrected and new activity will not be tracking, including new trainings, warm-ups and so on. If you will go for a training than, you will see 0 calories despite your pulse. I have a video and photos of this bug if you need it. Thank you.
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Hi! We are building an app that collect steps counts. We are testing on an Apple Watch. Our case scenario is that tester uses both iPhone and watch during the day then removes the Watch around 10.30pm and goes to bed. iPhone is always within 2m of the watch so within range for a sync. Our tester usually checks the app in the morning and when the app opens, we are collecting the steps from HealthKit that occurred until 11h59mn59s last night. At this stage, we do believe that the watch did synchronise (maybe multiple times) with Health App during the night so Health Data and steps count returned by HealthKit should be the same. However, we can observe that the app data always shows a (small) difference compare to the Health App. (One can note that it works fine when our tester only uses an iPhone for the steps count.) Does anyone know how often the Apple Watch does sync with the Health App and where is the flaw in our approach? Thanks!
Posted
by
Post marked as solved
17 Replies
2.5k Views
Hi, Xcode 12.5's iPhone simulator silently fails in sending its app context via updateApplicationContext() to the Watch simulator. No exception is thrown, so it appears as if everything is ok - but not really because the WatchOS simulator never gets the app context This works fine on real devices as well as earlier versions of Xcode. Doing a updateApplicationContext() from the WatchOS simulator to the paired iPhone simulator does work. I filed a bug report for this issue, because this behavior has been in Xcode 12.5 since the beta version: FB9095737 (Xcode 12.5 WatchOS Simulator never receives application context from iPhone counterpart) Before anyone says "why not debug on a real device instead?", please be aware that due to the pandemic, while I do test on real devices, I can only debug on a simulator. Thanks
Posted
by
Post not yet marked as solved
1 Replies
566 Views
When I finish Running on AppleWatch, I can see the value of average cadence on Apple Watch's Workout App and iPhone's Fitness App, but I can't find any APIs about that value.However I'm not sure how does Fitness App calculated, I tried to get step count from HealthKit, and calculated the value, but the value is different from Apple's. Can you tell me how to get it correctly and accurately?
Posted
by
Post not yet marked as solved
1 Replies
549 Views
Hello all - I have built my first watchOS stand-alone app. It tracks moments of motionlessness and if the (adjustable) threshold is not reached in 15, 30 and 45 seconds it triggers an event a, b, c. I am building a string that records the seconds elapsed and the event. May be 100 lines max. Is there a SIMPLE way to text, email, send, share this string from watchOS w/out building out an entire Eco-system that relies on the paired phone? I saw a tutorial about writing to icloudDrive, but after a day of returning a nil URL I read: Turns out watchOS does not support iCloud Drive at all, nor does it support the key-value storage iCloud service. Seriously, if I can just text it to myself I'd be happy. Note: This is only for proof-of-concept programming - this will never be in production - so hacks are welcome! Best, Dan
Posted
by
Post not yet marked as solved
1 Replies
602 Views
I have a watchOS extension that I'm trying to sync to their iPhone using CoreData and CloudKit, but it doesn't seem to want to sync. I've tried a few solutions (CloudKit + CoreData on iOS and watchOS sync not working, Core data + CloudKit - sharing between iOS and watchOS companion app), but it's still not syncing. Here's my shared (it's loading in both targets) persistence code: import CoreData struct PersistenceController { static let shared = PersistenceController() static var preview: PersistenceController = { let result = PersistenceController(inMemory: true) return result }() let container: NSPersistentCloudKitContainer init(inMemory: Bool = false) { container = NSPersistentCloudKitContainer(name: "My-app") if inMemory { container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") } let description = container.persistentStoreDescriptions.first description?.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.mydomain.my-app") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { print("Unresolved error \(error), \(error.userInfo)") } }) container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy container.viewContext.automaticallyMergesChangesFromParent = true } } Should I have a different code for the watch? Right now both targets share all the files. Both targets share the same xcdatamodeld file. I used to have all the ManagedObject classes automatically generated (Codegen: Class Definition), but someone suggested manually generating them, but that didn't seem to change anything. Maybe the classes need to be different for each target (but what should be different)? Both targets have iCloud and background notifications enabled. I don't know if this matters, but I'm using SwiftUI. Here's the view model and the relevant code that loads the data (same file for both targets): import Foundation import CoreData import SwiftUI final class ProjectListViewModel : ObservableObject { private var viewContext : NSManagedObjectContext @Published var settings : Settings? @Published var coreDataHasError = false @Published var projects : [Project] init(viewContext : NSManagedObjectContext, settings : Settings? = nil) { self.projects = [Project]() self.viewContext = viewContext self.settings = settings if settings != nil { updateList() } } func updateList() { var orderBy : NSSortDescriptor = NSSortDescriptor(keyPath: \Project.dateModified, ascending: false) if settings != nil { switch settings!.orderBy { case Settings.OrderBy.dateCreated.rawValue: orderBy = NSSortDescriptor(keyPath: \Project.dateCreated, ascending: false) case Settings.OrderBy.alphabetical.rawValue: orderBy = NSSortDescriptor(keyPath: \Project.name, ascending: true) default: orderBy = NSSortDescriptor(keyPath: \Project.dateModified, ascending: false) } } let request : NSFetchRequestProject = Project.fetchRequest() request.predicate = NSPredicate(format: "status == %d", Project.ProjectStatus.active.rawValue) request.sortDescriptors = [orderBy] projects = try! viewContext.fetch(request) } } And the view (this one is only used by the watch): import SwiftUI import CoreData struct ProjectListView: View { @ObservedObject var viewModel : ProjectListViewModel @ObservedObject var settings : Settings @Environment(\.presentationMode) var presentationMode: BindingPresentationMode @Environment(\.managedObjectContext) private var viewContext init(viewContext: NSManagedObjectContext, settings: Settings) { self.viewModel = ProjectListViewModel(viewContext: viewContext, settings: settings) self.settings = settings } var body: some View { if quickCountProject.count == 0 { viewModel.addScratchProject() } return ScrollView { VStack { if viewModel.projects.count = 1 { ZStack { VStack { Text(NSLocalizedString("Title", comment: "Page title")) .TitleStyle() List { ForEach(viewModel.projects) { project in NavigationLink(destination: ProjectView(project: project, settings: settings, viewModel: ProjectListViewModel(viewContext: viewContext), viewContext: viewContext) .environmentObject(self.settings) .environment(\.managedObjectContext, viewContext)) { HStack { Image(systemName: "plus.app.fill").foregroundColor(.main).imageScale(.large) Text(project.name ?? "").font(.headline).padding(.bottom, 5).padding(.top, 5) } .accessibilityHint(Text(NSLocalizedString("View project details", comment: ""))) } } .listRowBackground(Color.lightGray) .padding(0) } .frame(minHeight: (45 * CGFloat(viewModel.projects.count))) } .padding(0) } } else { Text(NSLocalizedString("To start, add a new project on you phone or iPad. Or use the button below to do a quick count.", comment: "")) .fixedSize(horizontal: false, vertical: true) } } } .onAppear(perform: { viewModel.updateList() }) } }
Posted
by
Post not yet marked as solved
1 Replies
777 Views
I’m trying to read the battery level of a connected Apple Watch on an iPhone app. The built-in iOS Batteries widget shows the current Apple Watch battery level, so I know the data is being sent from Apple Watch to iPhone frequently, however I could not find a public API to read the level in my iOS app. My best solution so far was to build an Apple Watch app that periodically sends the battery level of the Apple Watch to the iPhone using WatchConnectivity. Then, I found this app. It can show the battery level of my paired Apple Watch without ever installing an app on the Apple Watch. To try to accomplish this same thing, I have tried a few different approaches. First, I tried Core Bluetooth, but after a lot of exploring, troubleshooting, and asking at a Core Bluetooth lab, I’ve ruled that out since Apple Watch does not expose its battery information that way. I experimented with the External Accessory framework, but that doesn’t seem like the right approach either, since it's for MFi accessories and I couldn't find a way to get Apple Watch info with it. How is it possible to read the Apple Watch battery level in an iPhone app without sending it from a companion Apple Watch app? Or is the app I linked to probably using private APIs?
Posted
by
Post not yet marked as solved
0 Replies
488 Views
Hey guys, I'm trying to create a custom swimming app, and I'd like to add the "When in Session" > "Return to App" option to my app (under settings > general > wake screen > [app name], like the workout app has). Otherwise, the moment I put my watch under water it goes back to the default clock app, when I raise to wake... would anyone happen to know how to do that? Sorry if it's a super obvious answer lol...
Posted
by
Post not yet marked as solved
0 Replies
447 Views
I’m having watchos 8 Public beta on my watch series 4. My country (Ukraine) was added to list which supported ECG with new software update but I still don’t have option that allows me to use ECG. Is there some bug or we will have another update which will activate this option my watch?
Posted
by
Post not yet marked as solved
1 Replies
601 Views
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!
Posted
by