Post not yet marked as solved
Would be Watch OS App developer here.
Is an app like this possible?
Is an iOS app able to 'catch' the heart rate continuously from the Apple Watch which is running an Apple Workout App workout?
Thanks for your answers!
Post not yet marked as solved
Need some basics help getting crash data and itunes crash data to watch OS team.
watch attached to any of 3 phones XR, 13, SEII -=- iTunes fails to complete sync usually hangs on "Step 2 of 3 Preparing to sync" for hours or days. un pair syncs fine
1a. sometime by using phone |watch app | general | diagnostic logs | down load local copy of all logs | iTunes may sync.
1.c Canceling sync never cancels - Have to force quit iTunes restart PC
go to 1 again an failure
Is there anyway to force the phone to collect/submit the watch os data in advance of iTunes sync.
Post not yet marked as solved
let stagePredicate = HKCategoryValueSleepAnalysis.predicateForSamples(.equalTo,value: .asleepREM)
let queryPredicate = HKSamplePredicate.sample(type: HKCategoryType(.sleepAnalysis), predicate: stagePredicate)
let sleepQuery = HKSampleQueryDescriptor(predicates: [queryPredicate], sortDescriptors: [])
do{
let sleepSample = try await sleepQuery.result(for: store)
print("sleep sample ")
print(sleepSample)
with health app on iOS ,
it says I did rem sleep for 59 minutes.
but all sum of sleep sample time is not 59 but 3.7hours.
time is also not accurate.
sleepSample log is as below
what may be the problem?
Post not yet marked as solved
My guess the issue is that the iOS app is com.example.MyApp and the bundle id for the watchOS app is com.example.MyApp.watchkitapp, so WeatherKit works perfectly on the iOS app after registering bundleID and request WeatherKit service.
But it does not work on watchOS, giving me 401 errors. I assume it is because of the bundleID, but maybe something else.
2022-06-25 08:58:58.999485-0500 JumpLog Watch App[72341:1201484] [WK_Geocode] failed to reverse geocode. location=CLLocationCoordinate2D(latitude: 37.62471885, longitude: -122.42857813), error=reverseGeocodeFailed(Error Domain=NMDeviceConnectionErrorDomain Code=2 "Timed out." UserInfo={NSDescription=Timed out.})
2022-06-25 08:58:59.019561-0500 JumpLog Watch App[72341:1201484] [Database] Attempting to invalidate an assertion that is no longer valid
2022-06-25 08:58:59.724802-0500 JumpLog Watch App[72341:1198856] [WeatherService] Encountered an error when fetching weather data subset; location=<+37.62471885,-122.42857813> +/- 5.00m (speed 34.21 mps / course 332.23) @ 6/25/22, 8:56:58 AM Central Daylight Time, error=invalidJWTResponse(Optional(<NSHTTPURLResponse: 0x60000394bf20> { URL: https://weather-data.apple.com/v2/token } { Status Code: 401, Headers {
Connection = (
close
);
"Content-Length" = (
0
);
Date = (
"Sat, 25 Jun 2022 13:58:59 GMT"
);
Server = (
Apple
);
"Strict-Transport-Security" = (
"max-age=31536000; includeSubdomains"
);
"X-Apple-Origin" = (
"8961098f-b238-3714-ba44-5b569c861456"
);
"X-Cache" = (
"TCP_MISS from a23-33-47-144.deploy.akamaitechnologies.com (AkamaiGHost/10.8.2-41841244) (-)"
);
"X-Content-Type-Options" = (
nosniff
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-REQUEST-ID" = (
"2076edab-2346-4a50-83c1-e62f46aab9eb"
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }))
Post not yet marked as solved
everytime i try to connect the apple watch s2 with WatchOS 6.3 with the iPhone Xr with iOS 15.5 the watch app tell me to update de iOS, how do i fix it?
WWDC 2022 announced CallKit for WatchOS 9, but didn't explain how to use it. I was able to convert SpeakerBox sample from iOS to WatchOS. The CallKit itself seems works fine, but I stuck with networking issue. I cannot understand how to stream RTP audio. I have background audio enabled. If I configure audio session for CallKit with .playAndRecord category, I cannot specify .longFormAudio policy, as it's not applicable for this category. Without .longFormAudio low lever API is denied ("Path was denied by NECP policy").
Post not yet marked as solved
From wtchos 8+ After that, the support screen is always displayed, but I don't know how to set up spritekit Always On. I hope there are relevant documents or examples. Thank you
Post not yet marked as solved
Has anybody managed to get .preferredColorScheme(.dark) working in a watch app in the watchOS 9 beta simulator? It works fine for me on iOS, but doesn't seem to have an effect on the watch.
I'm on the first Xcode 14 beta.
Post not yet marked as solved
Xcode 14 beta 1 is yelling at me that CKNotification initializer should return a non-optional value. This happens only AFTER letting Xcode upgrade my project settings.
The change that the upgrade project settings made was it merged my WatchKit and WatchKit extension targets into a single watch app target.
After doing so, this code will not compile which I know to be good.
// This line fails to compile with '
if let notification = CKNotification(fromRemoteNotificationDictionary: userInfo) {
// Do something
}
Compile error: "Initializer for conditional binding must have Optional type, not 'CKNotification'"
Feedback w/ sysdiagnose:
FB10282805 - watchOS / CloudKit: CKNotification doesn't return optional, xcode build failing after updating project settings for Xcode 14
I could not reproduce this in a sample application. I tried making a standalone watch app with Xcode 13, upgrading the project file with Xcode 14 beta, and then creating a CKNotification object--but that worked fine. :/
Post not yet marked as solved
reference : https://wjwickham.com/posts/refreshing-data-in-the-background-on-watchOS/
on init function ,
which mean, for every 5 min it should come to
handle function in Extension Delegate.swift
but it won't come to handle any
anything else that I should do ?
let preferredDate = Date().addingTimeInterval(60 * 5)// 5min later
preferredDate, userInfo: nil) { (error) in
WKExtension.shared().scheduleBackgroundRefresh(withPreferredDate: preferredDate, userInfo: nil) { (error: Error?) in
guard error == nil else {
print("Couldn't schedule background refresh.")
return
}
print("Scheduled next background update task for: \(preferredDate)")
}
ExtensionDelegate.swift
//
// ExtensionDelegate.swift
// Coffee Tracker WatchKit Extension
//
// Created by pedro jung on 2022/06/15.
// Copyright © 2022 Apple. All rights reserved.
//
import Foundation
import WatchKit
class ExtensionDelegate: NSObject,ObservableObject, WKExtensionDelegate {
func applicationDidFinishLaunching() {
print("applicationDidFinishLaunching")
// Perform any final initialization of your application.
}
func applicationDidBecomeActive() {
print("applicationDidBecomeActive")
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillResignActive() {
print("applicationWillResignActive")
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, etc.
}
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
for task in backgroundTasks {
switch task {
case let backgroundTask as WKApplicationRefreshBackgroundTask:
BackgroundService.shared.updateContent()
backgroundTask.setTaskCompletedWithSnapshot(false)
case let urlSessionTask as WKURLSessionRefreshBackgroundTask:
BackgroundService.shared.handleDownload(urlSessionTask)
default:
task.setTaskCompletedWithSnapshot(false)
}
}
}
}
I also check other way
after checking reply of below link
https://developer.apple.com/forums/thread/661892
but with no luck ...
import SwiftUI
import WatchKit
@main
struct CoffeeTrackerApp: App {
@Environment(\.scenePhase) var scenePhase
@WKExtensionDelegateAdaptor(ExtensionDelegate.self) var delegate
@SceneBuilder var body: some Scene {
WindowGroup {
NavigationView {
ContentView()
}
.onChange(of: scenePhase) { phase in
switch phase {
case .active:
print("\(#function) REPORTS - App change of scenePhase to ACTIVE")
case .inactive:
print("\(#function) REPORTS - App change of scenePhase Inactive")
case .background:
let preferredDate = Date().addingTimeInterval(60 * 1)// One hour later
// delegate.shared().scheduleBackgroundRefresh(withPreferredDate: preferredDate, userInfo: nil) { (error) in
WKExtension.shared().scheduleBackgroundRefresh(withPreferredDate: preferredDate, userInfo: nil) { (error: Error?) in
guard error == nil else {
print("Couldn't schedule background refresh.")
return
}
print("Scheduled next background update task for: \(preferredDate)")
}
delegate.test()
default:
print("\(#function) REPORTS - App change of scenePhase Default")
}
}
}
}
}
Post not yet marked as solved
Hello all! I have a Series 2 Apple Watch, and I'm having trouble running an update due to the fact that I get an error that says I'm not connected to the Internet. This is perplexing because I am connected to the internet on my iPhone. I haven't used my watch in a long time, and I don't know what is happening. I did a factory reset and it says it won't continue setup until I get the watch updated. Maybe it's because my iPhone is running IOS 15.5? I'm not sure.
I reset both the watch and the phone but that didn't seem to work. I even tried changing the Wi-Fi network, and that didn't do anything either.
Has anyone else had this issue?
Thanks in advance!
Post not yet marked as solved
Is it possible to downgrade the watchOS 9 beta? I found that an Apple Store visit can archive it but that's not possible for everyone.
Post not yet marked as solved
Are there commands for testing watch complications in XCUITest?
So far I see that we can press the home button and rotate the Digital Crown in test
As of Xcode Version 14.0 beta (14A5228q) the XCUITest record function doesn't work.
Can't find anything in debugDescription to helpout either with reaching complications
https://developer.apple.com/documentation/xctest/xcuidevice/button
Post not yet marked as solved
We are building an application that would be cross-platform and hence using CMake as the build system. While am able to build for iOS, macOS, tvOS etc, have not been able to build for watchOS using CMake. Right now, am looking for an independent watchOS app. Can someone help with any pointers or reference link for the same ?
Post not yet marked as solved
Just curious whether anyone had any resources on the security of data sent via the Watch Connectivity APIs (e.g. updateApplicationContext or sendMessage)?
Developing an app that will send data to an apple watch from a companion iOS app. The data we will be sending is events (think like syncing a users calendar between their phone app and watch app), so not super-secure that it should be in keychain, but not something we also want to be flying around for anything to listen to.
Haven't found any resources on this, or in any of the past WWDC videos, so any advice or guidance would be great.
Thanks 😊
I have a simple complication-only app called Roughly, which shows the approximate time in words, to the nearest five minutes, in a choice of languages. It's been on the store for several years, and it's getting creaky.
This new guide to WidgetKit is making me nervous: https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app
There's a line buried in there:
watchOS 9 and later no longer shows families like CLKComplicationFamily.circularSmall, CLKComplicationFamily.modularSmall, or CLKComplicationFamily.modularLarge on watch faces.
So... is that the end of all basic complications that haven't been made into Widgets? If so, it would be good to have more clarity on this — I do feel it's easy to miss when things are deprecated.
Thanks for any info!
Post not yet marked as solved
The sleep data isn’t showing up on my health app, like the sleep last night was recorded, but the data isn’t showing for the sleep stages. Any way to fix? Thanks
Post not yet marked as solved
We want to test auto renewable subscription in the sandbox.
On my personal iPhone is my personal production account.
On my personal iPhone is a sandbox account.
But:
When I want to buy subscription in the sandbox on the watch, then the watch shows the error: "Buying the app is not possible. Login with your iPhone with the Apple Watch App with your Apple-ID."
When I take a look in the watchApp --> General --> AppleId then I see my production account.
QUESTION: How can I use the sandbox Account to test subscription?
Post not yet marked as solved
Hello guys,
I am fetching a string from a server, and print it in a text field. It works fine:
let remoteContent = fetched.content
Text(remoteContent)
If I split it, and try to print elements, I get a black screen.
I tried casting substring to String and NSString etc. but didn't manage to get it to work.
I'm new to Swift and I must say... It's quite overwhelming!
Here's the problematic code:
let remoteContentArray = remoteContent.split(separator: Character(","))
Text(String(remoteContentArray[0]))
I tried it in the playground and it works fine.
But in a view no chance.
I tried directly using a dummy string like "some,words,separated,by,commas"
And it works! But why does it behave like this with the fetched string?
PS. Is it just me, or is Swift kinda hostile to learn?
Thanks a lot.
Post not yet marked as solved
Just trying to gain some information here on the new beta.
When updating to IOS 16 Beta do you have to update the watch to the new beta too? Or Can it stay on Watch OS 8.6.
Have been lead to believe the battery drains on the watch with compassion IPhone on IOS 16 and the watch app doesn’t let you control the watch anymore it just shows the discover page?
Is anyone able to confirm their experience with this? Thanks