Post

Replies

Boosts

Views

Activity

How to delete Exercise minutes data from the activity ring?
I have followed the below function to delete the HKWorkout object, It is deleting Active Energy and Distance data but it is NOT deleting Excercise minute data, so the activity ring always displays Excercise minutes data even after deleting a particular workout entry. let predicate = HKQuery.predicateForSamples(withStart: workout.start, end: workout.end, options: .strictStartDate) let findQuery = HKSampleQuery(sampleType: deletedType, predicate: predicate, limit: 1, sortDescriptors: nil) { query, results, error in if results != nil { print("\nHere we got not nil on results!\n") for result in (results as? [HKWorkout])! { self.healthStore.delete(result) { [unowned self] (status, error) in if status == true { print("Successfully deleted HKWorkout.") } else { print("Error \(String(describing: error?.localizedDescription))") } } } } else { print("results are nil") return } } self.healthStore.execute(findQuery)
1
0
692
Jun ’21
Apple Watch not displaying my fitness app data on Exercise Minutes ring (Can we write “Exercise Minutes” to HealthKit?)
We have a Fitness app and we are writing fitness data to the Healthkit like Steps, Walking Running distance, and Active energy. and it is working as expected in the Health App. We also writing Workout data for Apple watch activity ring, we can see our data is reflected on the Apple Watch activity ring for Active Energy but not for Exercise Minutes. I've followed this document to - https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/adding_samples_to_a_workout create a workout sample for the Activity ring So my question is, is there a way by which the Apple Watch activity ring can display my app data(exercise duration) on the Exercise Minutes ring? For reference, I've attached a screenshot and highlighted the Excercise portion on the same. https://stackoverflow.com/questions/65323810/apple-watch-not-displaying-my-fitness-app-data-on-exercise-minutes-ring-can-we
1
0
508
Dec ’20
Sign in with Apple missing email claim in the (JWT) identityToken
We have implemented a sign in with Apple(SiwA) for our iOS app. for the signup we require the user's Apple id and email address. We are getting user name and email details on first login attempts but after that to get the email we are decoding identity token and get the email address.We observed that the identity token does not always contain the email address.Please follow the below steps to reproduce the issue.step 1: User clicks on Sign in with Apple button and it displays Apple authorization popup with details like name, share-email, and hide email option then in success response we get an email in received apple identity token.step 2: Now user revoke signing access from the apple account by following steps (Setting -> Apple account -> Password & Security -> Apple id logins -> remove the app from options)step 3: After step 2, User clicks again Sign in with the apple button and usually, it shows Authorization popup with details like step 1 and we got an email from the identity token in this case so we don't have any issue.step 4: After step 2, the user clicks on the sign in with the Apple button and authorization popup contains only email address instead of a name, share email, or hide email options. In this case, we didn't get an email from the identity token.The main problem is Authorization popup is not resetting after revoking access, it shows like previously logged-in state, and in this case, we don't get email otherwise we always get an email address from identity token.Can we debug/identify why Authorization popup is not resetting after revoked access?Any help would be appreciated.
15
2
20k
Apr ’20
Duplicate entries of data in the Health app
We integrate Healthkit in our Fitness app and asked permission to write data for Active energy, Steps and Walking plus running distance.Whatever data collected from our Fitness device, we process it and write individually in the Apple Health, it is working as expected.Recently, we are trying to contribute our Fitness data into Apple watch activity ring, For that, we asked Workout permission, we followed the article which is posted on the developer apple documentation website. We implemented the same and It is working, We can see our Fitness data in the activity ring.Now, we have a total of Four permissions from the Healthkit to write data.So, whenever, our Fitness device sends data to our App, Our app process it and writes data for Active energy, Steps, Walking plus running distance and Workout(samples for Apple watch Activity ring) in the Health app. While creating a workout sample we are adding additional information in the Workout like Active energy, Steps and walking plus running distance.In the Apple Health app, when we check what data our application has written, we found double entries.As per our observation, if we revoke workout permission from Health app and write data only for the remaining three permissions then it’s working aspected and showing correct entries in the Health app. But it’s creating duplicate entries if we write data for all permission that we have asked.It is working fine(show correct entries in the Apple Health app) if we write only three Active energy, Steps, Walking plus running distance or if write only a Workout but it showing duplicate entries if we write data for all.Now, my question is,Is there any way to prevent duplicate entries in the Healthkit app? What is a better approach to writing data in the Health app along with all permissions Active energy, Steps, Walking plus running distance and Workout?Any help is appreciated.
0
0
1.9k
Feb ’20