Why do I always get 72 BPM from the Apple Watch?

EasyGoingPatEasyGoingPat GBMember ✭✭✭

I have got a sample HealthKit application (https://developer.xamarin.com/samples/monotouch/ios8/IntroToHealthKit/) building, deploying and running fine. The problem is that the code always records 72 BPM, regardless of my actual heart rate. I have a sneaky feeling that 72 BPM is what the Watch defaults to before it manages to sense your actual heart rate.

The application does seem to have a working connection to the Watch because if I revoke the heart-rate permission, the application recognises this and displays an appropriate message. If I turn the heart-rate permission back on, the application also recognises this.

Also, the phone and the watch must be connecting correctly because the inbuilt Health application records the correct values.

Does anyone have any experience using the HealthKit to access values such as heart rate from the Apple Watch? Can anyone see anything wrong in the solution I have linked to above that may give a clue why this is not working? Any help or suggestions would be very much appreciated.

Kind wishes ~ Patrick

Best Answer

  • EasyGoingPatEasyGoingPat GB ✭✭✭
    Accepted Answer

    I think this issue is simply my misunderstanding. I installed a demo app for the HealthKit. This always reads 72 BPM. This demo app does not, however, have the WatchOS Extension and the code that runs on the Apple Watch. Therefore, there is no way for it to get new data. I am assuming that the fixed 72 BPM has simply been added somewhere as example data.

    • Patrick

Answers

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭
    Accepted Answer

    I think this issue is simply my misunderstanding. I installed a demo app for the HealthKit. This always reads 72 BPM. This demo app does not, however, have the WatchOS Extension and the code that runs on the Apple Watch. Therefore, there is no way for it to get new data. I am assuming that the fixed 72 BPM has simply been added somewhere as example data.

    • Patrick
  • OnurHazarOnurHazar USUniversity ✭✭✭

    @EasyGoingPat
    Hello Patrick, Is there any Xamarin example that we can look for getting heart rate from apple watch? so far I found speedysloth example (https://github.com/xamarin/ios-samples/tree/master/watchOS/SpeedySloth/SpeedySloth) but it only shows how to create workout sessions not getting any heart rate data.

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @OnurHazar

    Hi! Not got this working yet because I have been working on other projects, but I am intending getting back to this soon.

    From what I remember before I had to leave it, it seems that you have to create a HKWorkout in iOS. This allows a background process to continue longer than normal (I think iOS suspends most processes after about six minutes of inactivity).

    If/when I get this working, I'll gladly post some code.

    • Patrick
  • OnurHazarOnurHazar USUniversity ✭✭✭

    @EasyGoingPat

    That would be awesome. Thanks Patrick! I will also share a sample if I achieve to get heart rates.

Sign In or Register to comment.