dpa99c / cordova-diagnostic-plugin

Cordova/Phonegap plugin to manage device settings
539 stars 361 forks source link

Physical Activity Recognition get authorization status #455

Closed CreetionMotia closed 2 years ago

CreetionMotia commented 2 years ago

Much like the getMotionAuthorizationStatus() function for iOS, I'd like to get the authorization status of Physical Activity Recognition on Android.

dpa99c commented 2 years ago

You can already do this using getPermissionAuthorizationStatus(), for example:

var physicalActivityPermission = cordova.plugins.diagnostic.permission.BODY_SENSORS;

cordova.plugins.diagnostic.getPermissionAuthorizationStatus(function(status){
    console.log("Physical activity recognition permission status: " + status);
}, function(error){
    console.error("The following error occurred: "+error);
}, physicalActivityPermission);