Tizen 4.0 Web app privileges are broken

Privileges work different in different projects.

Environment details:
Galaxy Watch Active 2 SM-R820
Tizen 4.0.0.7
Wearable v4.0 Web Application

How to reproduce:

  1. Create BasicUI and TAUBasic projects in Tizen Studio 3.7
  2. Add following privileges in config.xml for both projects:
    <tizen:privilege name=“http://tizen.org/privilege/bluetooth”/>
    <tizen:privilege name=“http://tizen.org/privilege/healthinfo”/>
  3. Add following code in the app.js for TAUBasic and main.js for BasicUI projects.
    var adapter = tizen.bluetooth.getDefaultAdapter();
    tizen.humanactivitymonitor.start(‘HRM’, function a(b) {}, function c(d) {});
  4. Run in debug mode on Galaxy Watch Active 2

BasicUI project throws WebAPIException “Permission denied” on humanactivitymonitor start, but successfully runs bluetooth.
TAUBasic throws the same exception (WebAPIException “Permission denied”) on the bluetooth line, but successfully starts humanactivitymonitor.

Is it possible to get both privileges in Tizen Web project?

Hi,
Please check the below code,

function onSuccess() {

    function onchangedCB(hrmInfo) {
        console.log(‘heart rate:’ + hrmInfo.heartRate);
        tizen.humanactivitymonitor.stop('HRM');
    }
    tizen.humanactivitymonitor.start('HRM', onchangedCB);
}

function onError(e) {
    console.log("error " + JSON.stringify(e));
}
tizen.ppm.requestPermission("http://tizen.org/privilege/healthinfo",onSuccess, onError);

Check this blog for full Heart rate app

https://developer.samsung.com/sdp/blog/en-us/2019/10/02/use-tizen-web-to-measure-heart-rate-with-galaxy-watches

Before Tizen 4.0, the pop-up requesting the user’s consent to use privacy-related privileges was triggered by first access to protected resources or functionality. Since Tizen 4.0, you can decide the moment in the application life-cycle when permissions are granted.

https://docs.tizen.org/application/web/guides/security/privacy-related-permissions/

Thanks