语言

Menu
Sites
Language
SecurityError HRM

Hello,

 

I am currently working on a widget that uses the heartrate of the user to manipulate the

design of the watch. I obtain the data using this methods:

window.webapis.motion.start("HRM", onchangedCB);

function onchangedCB(hrmInfo) 
{
   if(hrmInfo.heartRate > 0)
       hr = hrmInfo.heartRate;
}

I also have the healthinfo priviledge enabled in my config.xml.

Everytime i try to start the application from eclipse onto my gear 2 neo, I get the following Error:

SecurityError: The application does not have the privilege to call this method.

 

Do I miss a privliedge I might need?

 

Kind regards, Lukas

 

 

查看选择的答案

响应

9 回复
Madhuri A

Please try running the "Check Privilege" from Wearable IDE. It will show the API which requires privilege.

Gökhan Kurt

Hi all

 

I am having the exact same issue and Check Privilege is not saying anything.

Did you manage to solve this?

Gökhan Kurt

I now see that in 1.0.0b2 they have made following change

Web Device API MotionType “HRM” and “SLEEP_MONITOR” are removed from the Motion API.

What does that mean? Is it not possible anymore to get these event changes?

Todd Anderson

I am also very curious about the scope of the Motion API. Will heart monitor functions be returning soon?

Michał Macioła

Any progress with HRM and web developemnt? 

Lukasz Skierkowski

Hello,

Did you manage to solve this problem? I have the same issue. Examples from IDE are working, but i can't get the HRM working. Do you know any working example? 

Thank you

Mark as answer
Todd Anderson

Okay, I heard back from Samsung. For HRM you need two privileges: 

"http://developer.samsung.com/privilege/medicalinfo"

"http://developer.samsung.com/privilege/healthinfo"

 

I can get HRM data in my app now.

Lukasz Skierkowski

Thanks, that helped. Its strange I havent seen this privilege before :£

Todd Anderson

Yea I think it is undocumented! It really is a beta SDK...