0

My task is to get data on the pulse in realtime. For this, I save the data in HealthKit using the workout session type “other”.. The problem is that when using this and other tested types of workout sessions, such as yoga, running and so on, the activity rings are filled. How to get rid of it? Please help me, this problem keeps me awake.

All types of workout sessions tried to not store data to HealthKit after session complete

HKWorkoutConfiguration *config = [HKWorkoutConfiguration new];
config.activityType = HKWorkoutActivityTypeOther;
config.locationType = HKWorkoutSessionLocationTypeIndoor;
HKWorkoutSession *wSession = [[HKWorkoutSession alloc] initWithConfiguration:config error:&error];
[self.healthStore startWorkoutSession:wSession];

[self.healthStore endWorkoutSession:self.workoutSession];
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Halina
  • 1
  • 1
  • Please show what you have tried by posting some code. – TmKVU Jun 06 '19 at 10:08
  • So your logging activity but don't want that activity to count towards daily goals? – Scriptable Jun 06 '19 at 11:01
  • No, im just want to get heart rate without filling activity ring. To do this, i'm starting workout session. I heard something about not storing data to healthkit after workout is complete, but im not sure ( – Halina Jun 06 '19 at 11:21
  • Pause the workout session as soon as it is started. https://stackoverflow.com/a/64288974/8174191 – Rexios Oct 10 '20 at 01:05

0 Answers0