Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simulator and Companion Permission errors.

I've been searching the threads and haven't been able to find any answers, so I hope I'm not repeating an issue.

 

Note: I am using VS Code and CLI to develop with. 

 

I am putting some settings into settingsStorage that will be used in the Settings page to determine whether or not to display certain items.

 

In my companion/index.js I have the import line: import { me } from "companion";

 

Then to set my values I use :

settingsStorage.setItem("accessactivity", getPermission("access_activity"));

 

getPermission is a function:

function getPermission(requestedAccess) {
 if (me.permissions.granted(requestedAccess)) {
  return true;
 } else {
  return false;
 }
}

 

When the call is made, I get the response  - Companion: The 'permission' API is not yet supported in the Fitbit OS Simulator. Behavior may not match the documentation or real devices.

 

All of the values returned are undefined.

 

Is there a fix? I am using these values to dynamically change the settings displayed on the Companion Settings page based on whether or not the sensor is present and/or permission has been granted.

 

Thanks for any help with this!!

Best Answer
2 REPLIES 2

Have you found a fix? I defined access_internet in package.json and it works fine on real device, but not in simulator. The same error.

 

"requestedPermissions": [
      "access_internet"
    ],

 

@JonFitbit - any clue?

Thanks.

Best Answer

The warning about permissions not being implemented may not be a problem for you. It just means that the sim won't attempt to block anything for which it doesn't have permission.

Peter McLennan
Gondwana Software
Best Answer