Approach S60 getHeartRateHistory causes crash of watch face

Former Member
Former Member
Approach S60 with fw 2.90 crashes if getHeartRateHistory method is used. This used to work but now suddenly causes crash (simulator error: Could not find symbol getHeartRateHistory.Failed invoking <symbol>Symbol Not Found Error)

This works correctly in simulator with SDK 2.3.2 but not with 2.3.3 or 2.3.4 (latest).

It is mentioned in above documentation that it is supported by S60, and it was also before : https://developer.garmin.com/downloa...orHistory.html

Since:
  • 2.1.0


Supported Devices:
  • Approach S60
  • fenix 3 HR
  • fenix 5/S/X
  • fenix Chronos
  • Forerunner 735xt
  • Forerunner 935
  • vivoactive HR

EDIT: maybe this is done on purpose as S60 does not have wrist HR? I have anyway implemented workaround/fix in my watch faces and they are not crashing anymore.
  • The Approach S60 doesn't have an OHRM and shouldn't be on the list. You need to do something like a "has" check for getHeartRateHisory, because that call isn't available on the S60. . A thing to note is the vivoactive3 does have OHRM, as do things like the D2 Charlie, so the list needs to be updated.

    Using "has" is very useful in this case.
  • Former Member
    Former Member
    ^yep, was using "has" but not everywhere and that is where crash occured. Now added everywhere. With previous SDK's it did not crash.
  • with getHeartRateHistory, that's something I use "has" for all the time, even in things like Simple Heart where I only support targets with WHR. You could also set something if you use resource overrides.

    I only do the "has" once - in initialize - and set a boolean - as it only really needs to be done once and is more expensive than just checking a boolean. There's no need to do "has" checks in things like onUpdate - just use the boolean.
  • It is mentioned in above documentation that it is supported by S60, and it was also before : https://developer.garmin.com/downloa...orHistory.html


    FWIW, that doc says SensorHistory is supported by Approach S60 (which must still be a mistake, since none of the instance methods seem to be supported by S60).

    The doc for getHeartRateHistory says:
    https://developer.garmin.com/downloa...nstance_method
    Supported Devices:
    • fenix 5/S/X
    • fenix Chronos
    • Forerunner 735xt
    • Forerunner 935
    • vivoactive HR
  • Former Member
    Former Member
    This is a bug in the API Docs. I believe when we wrote them we believed that the S60 was going to have SH support and never pulled it from the docs. We will get the fixed.

    Thanks,
    -Coleman
  • Former Member
    Former Member
    I only do the "has" once - in initialize - and set a boolean - as it only really needs to be done once and is more expensive than just checking a boolean. There's no need to do "has" checks in things like onUpdate - just use the boolean.


    Good point, was changing to this approach as well.