Languages

Menu
Sites
Language
Security exception while accessing HRM

Hello,

I'm trying to run the sample as shown here, https://developer.tizen.org/ko/development/guides/web-application/sensors/human-activity-monitor?langredirect=1#retrieve on the Samsung Galaxy watch. But, I get a "SecurityError: Permission denied" exception.

I have these privileges defined in my config.xml.

<tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
    <tizen:privilege name="http://tizen.org/privilege/location"/>
    <tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>
    <tizen:privilege name="http://developer.samsung.com/privilege/healthinfo"/>
    <tizen:privilege name="http://developer.samsung.com/privilege/medicalinfo"/>

The same happens when I try to execute the equivalent native code too. Am I missing anything? Thank you.

View Selected Answer

Responses

1 Replies
Mark as answer
André Reus

Hi, You need to give permissions for location and sensors from Galaxy Watch settings. To give permissions

Goto 

Settings > Apps > Permissions > Your app => give permission for location and sensors 

This is the manual process. Problem of this process is, most of the users don't know about this (may be till now)...they will think the app is not wokring! 

Better solution:

Get run time permission from user after installation by ppm.requestPermission(). This will pop-up for permission after installation. 

Here is an example for mediastorage....you should do it for location and your desired sensor

    tizen.ppm.requestPermission("http://tizen.org/privilege/mediastorage", onsuccessPermission, onErrorPermission);

Also see this 

https://developer.tizen.org/community/code-snippet/web-code-snippet/using-file-system-api-on-tizen-4.0