Languages

Menu
Sites
Language
StressMonitorDataRange seems to be unknown

Hello,

I'm trying to implement the stress monitoring API in a wearable web application. I tried to use the documentation on the link below 

https://developer.tizen.org/development/guides/web-application/sensors/human-activity-monitor#monitoring-stress

I did add those prerequisites into the config.xml file :

<tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
<tizen:privilege name="http://tizen.org/privilege/location"/>

But still, when I try to put those lines as shown in the documentation :

var listenerId;

function errorCallback(error)
{
    console.log(error.name + ": " + error.message);
}

function listener(label)
{
    console.log("Stress level: " + label);
}

 var ranges = [new tizen.StressMonitorDataRange("Normal",10, 15),
           new tizen.StressMonitorDataRange("Stress Alarm",15, 17)];

try
{
    listenerId = tizen.humanactivitymonitor.addStressMonitorChangeListener(ranges, listener, errorCallback);
}
catch (error)
{
    console.log(error.name + ": " + error.message);
}

I get this error :

Uncaught TypeError: tizen.StressMonitorDataRange is not a constructor

As if StressMonitorDataRange did not exist. I have the latest updates of all the packages and I'm working on the galaxy watch active so I can't think of anything causing this. I would be really greatful to have any clue on this. 

Thank