Fitbit/golden-gate

Permissioning of NSBluetoothAlwaysUsageDescription for Stack Tool

mnm364 opened this issue · 3 comments

Hello there!

I am trying to work through some of the examples building and running this application. Specifically, I am trying to run Stack Tool - gg-stack-tool - with Bluetooth on my MacOS (Big Sur) with

gg-stack-tool --bottom bluetooth connect hub DSNG

However, I keep getting a failure that I was able to track back using lldb to MacOS permissioning issues:

2021-01-20 12:27:15.983030-0800 gg-stack-tool[82249:687439] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

I have attempted updating every instance of an Info.plist in the repository with this key

find . -name Info.plist | xargs -IPLIST plutil -replace NSBluetoothAlwaysUsageDescription -string 'Please allow Bluetooth so this application can work!' PLIST

However, even after rebuilding the entire application - inv native.clean followed by inv native.build - I am still plagued by the same error.

Where can I add this permission to have the build system pick it up for the Stack Tool?

Thanks in advance for your help. Appreciate your time!

Hi,

Thanks for reporting this issue. I'll look into it shortly and let you know what I can find out and if there's a simple workaround or if this will require a code update.

I was able to reproduce this issue on a macbook running Big Sur.
If you use the built-in Terminal app to run the gg-stack-tool command line app, Terminal is smart enough to prompt the user for Bluetooth permissions, and everything works fine: the first time you run the tool, you get a popup asking to use Bluetooth, then from that point on everything you run from Terminal can use Bluetooth (no more popups). However, if you use a different terminal app (ex: iTerm), then that doesn't happen automatically. You need to manually add your terminal app to the Allowed list for Bluetooth: System Preferences -> Security & Privacy -> (Privacy Tab) -> (BlueTooth selection on the left), add/enable your terminal application.
See https://fitbit.github.io/golden-gate/getting_started.html for a screenshot of what that looks like.

Thank you, this works great! Thanks for adding to the docs as well!