Post not yet marked as solved
I'm trying to observe .irregularHeartRhythmEvent using HKObserverQuery.
Code, I'm using to subscribe to this event:
private func subscribeForAbnormals() {
let abnormals = HKCategoryType.categoryType(forIdentifier: .irregularHeartRhythmEvent)!
healthStore.enableBackgroundDelivery(
for: abnormals,
frequency: HKUpdateFrequency.immediate
) { isSuccess, error in
let subscriptionStatus = isSuccess ? "OK ✅" : "FAILED ❌"
print("Irregular hearbeat subscription status: \(subscriptionStatus)")
if let error = error {
print(error.localizedDescription)
}
}
let query = HKObserverQuery(
sampleType: abnormals,
predicate: nil
) { [weak self] _, completionHandler, _ in
print("Irregular hearbeat detected")
completionHandler()
}
healthStore.execute(query)
}
Each time I call this function, I see output in my console:
Irregular hearbeat subscription status: OK ✅
Irregular hearbeat detected According to HealthApp, I have no cases of Irregular Hearth Rhythm.
Also, I havn't any options how to detect if triggered event is fake or not.
Absolutely same situation with .lowHeartRateEvent and .highHeartRateEvent
My app has all allowed accesses to HealthKit.
How can I actually subscribe for such kind of events to track this and notify user?
Post not yet marked as solved
FITPASS app is already on the App Store, but we were rejected during the last review. The app is available here -
https://apps.apple.com/in/app/fitpass-gyms-fitness-pass/id1049745078
The reason from the review team is that - 4 Safety: Physical Harm
5 Performance: Software Requirements
Guideline 1.4.1 - Safety - Physical Harm
Your app provides health or medical recommendations, calculations, references, wellness reports, or diagnoses without including the sources of the recommendations.
FITPASS only calculating customer BMI and RMR.
We do not understand where is the problem and why the app was approved multiple times and now not.
Can anyone help us to understand where can be a problem?
please suggest someone
Post not yet marked as solved
I am trying to sync my app with Apple's HealthKit. When I initially set up my app, it gave an option to share data with the Health app. I clicked "allow” for the read write permission. But now I have my app exporting blood pressure fine, but still my app is listed as 'inactive'! under the Data Sources.
Is there a way to fix that?
Deleting and reinstalling the app doesn't worked.
Can anyone help me with more information?
I am looking for a API for iOS that calculates ActiveEnergyBurned or Calories burned for my iOS app. I want the api to calculate as close to Apple Watch as possible.
Post not yet marked as solved
Is there anybody knowing if there is solution to put watchOS is single app mode? Seems like its possible for all devices except Apple Watches at the moment? Would be super useful to have any kind of info here. Thanks
Post not yet marked as solved
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?
Post not yet marked as solved
Lately we are experiencing some crashes / system terminations in our app, due to "exhausted real (wall clock) time allowance of 10.00 seconds".
I never was able to reproduce the issue, but my client states that it happened for him multiple times in a row. He sent me 2 crash reports, and both of them have the same structure:
The main thread blocked in [HKHealthStore authorizationStatusForType:] / semaphore_wait_trap
'Elapsed total CPU time' high, while 'Elapsed application CPU time' very low (like 0.006, 0% CPU in the following report)
He also sent me a 'wakeups report' together with the crash reports ("exceeding limit of 150 wakeups per second over 300 seconds"), maybe it can be related?
Did somebody encounter something similar or has any thoughts what could be the root cause?
Thank you very much in advance,
Full crash report attached.
Crash report
I also attached a code snippet; the following method is called on the main thread when an alert controller is dismissed:
func saveCyclingDistanceWorkout(distance:Double, startDate:Date, endDate:Date, workoutMetadata: WorkoutMetadata, workoutRouteBuilder: Any? = nil, completion: ((Bool, NSError?) -> Void)? = nil) {
// Check if permission is still enabled for cycling distance, else show error
var shouldUseCyclingDistance = true
let cyclingDistanceAuthorizationStatus = healthStore.authorizationStatus(for: HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceCycling)!)
if cyclingDistanceAuthorizationStatus == .notDetermined || cyclingDistanceAuthorizationStatus == .sharingDenied {
shouldUseCyclingDistance = false
}
...
Post not yet marked as solved
The AssistiveTouch is available for Watch Series 5 ?
Thank You
Post not yet marked as solved
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...
Post not yet marked as solved
Hi, I have a problem with HealthKit. When fetching sleepAnalysis, instead of getting a record for every night, I get multiple records for each night. How can I calculate the total amount of time for every day from the startDate and the endDate of every record? Thanks.
Post not yet marked as solved
As per apple documentation I go through them, after surfing I didn't get any of the basic implementation for electrocardio gram steps:
Request Permission.
Reading the values for data points.
Sample query.
Also need to understand, how this is different from HKCategoryTypeIdentifier/HKQuantityTypeIdentifier.
As in other heakthdata points the above identifier is used to formulate the data point accessing and reading and adding into our local storage.
Any sugesstion please.
Post not yet marked as solved
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!
Post not yet marked as solved
Hi, I have to develop an app to let the patients record a 20-30 seconds long video, upload it and show them some insights about it.
I know that both carekit and researchkit support charts to provide insights but which one of them will allow me to show a view controller to record the video?
Thanks for your time.
Post not yet marked as solved
Hi Team, I used below code to get active window details. but unable to find title of it. Can you please help me on it.
C# based code in Mac
var foreground_app = NSWorkspace.SharedWorkspace.FrontmostApplication;
foreground_app contains active application details. but i am not able to identify active window details
. guide me which property or function i need to use to get active window title details
EX: i opened Numbers, below condition will trigger
if(foreground_app.LocalizedName.ToLower().Contains("numbers"))
{
///
}
Post not yet marked as solved
Hello,
I am a physician. I have very little coding experience, but am able to learn. I am interested in potentially using apple watch in a small pilot project. In this project, the watch would be given to patients in a rural facility. I would like to remotely monitor these patients health data (heart rate, HRV, O2 saturation) by designing an apps that imports this data to a pre-existing Electronic Medical Record.
Important note, these patients likely will NOT have an iPhone. Is this concept possible?
Thank you for answering my question
Post not yet marked as solved
With this I can open Apple health:
“x-apple-health://“
but I’d like to open the page that contains myApp’s privacy settings.
Apple health settings>Privacy>Apps
Is there a way to go to this particular page in HealthKit?
Post not yet marked as solved
Hi,
I have noticed some drastic changes in some of the calculations/metrics that I get out of the Apple Health Apps since updating to the iOS15 Beta and WatchOS 8 Beta.
Let me preface this by saying there have been no changes to my health or workouts, way I use the watch or phone since updating.
For instance, my V02 max which has been in the 36-38 range for nearly two years suddenly dropped to 32-33 range since the update.
The Blood Oxygen measurements as well have been much more erratic - I am usually in the 97-100% range, but since updating I have been anywhere from 90-100, and if I take two measurements right after each other I might get one @ 90 and one at 100.
Thanks,
Remy
Post not yet marked as solved
Hi all,
Have anyone ran into the need to read/modify the iOS built-in Bedtimes setup? Could you point me to the documentation about how to read the Sleep or Wakeup alarm setting in Bedtime?
Thank you,
Will
Post not yet marked as solved
Hello all, this could surely be a newbie mistake but I'm unable to adopt this protocol to my class object I've created in a new project.
The Error: "Cannot find type 'OCKSurveyTaskViewControllerDelegate' in scope"
import CareKit
import CareKitUI
import CareKitStore
import ResearchKit
import UIKit
import os.log
final class CareFeedViewController: OCKDailyPageViewController, OCKTaskSurveyViewControllerDelegate {
}
However, I've been able to locate the 'OCKSurveyViewController.swift" file in the CareKit framework from SPM which has the protocol defined there, but I'm still unable to utilize it. Was the protocol only for demonstration purposes and not for use outside of the WWDC21 - CareKit Code Along?
Post not yet marked as solved
Hello everyone,
I'm making an app that saves rowing workouts. Rowing workouts are traditionally in meters. I want my workout summaries to always show in meters.
I have created and saved a HKWorkout instance. For the totalDistance, I am saving a quantity that uses HKUnit.meter() as its unit. Any intervals that I've associated with the workout are also saved with HKUnit.meter() as the unit.
When I look at the Workout in the Health app, it shows the total distance in miles. All the intervals are in miles as well
Is there a special piece of metadata that I need to add to my workout to hint to the Health app that I'd like to always see the summary using meters?
How can I get my workout to always be shown in meters in the health app?
Thank you for your advice,
_ michael