jaredks / rumps

Ridiculously Uncomplicated macOS Python Statusbar apps
BSD 3-Clause "New" or "Revised" License
3.06k stars 177 forks source link

[Question] Examples on how to ask for permissions in bundled apps #170

Closed ajatprabha closed 2 years ago

ajatprabha commented 2 years ago

I was trying to bundle an app that requires microphone permission.

In the development phase, it asks for permission via iTerm(terminal I'm using). But when I bundle the app, it doesn't ask for any permissions and fails to work, I tried to explicitly check and ask for the permission on app startup using PyObjC and pyobjc-framework-AVFoundation and following Apple docs with no luck so far.

Any examples on the same would be very helpful. TIA

ajatprabha commented 2 years ago

Found the solution:

Adding this to setup.py fixed the issue, I was first trying to manually edit the Info.plist, just putting this here for others to find.

OPTIONS = {
    'plist': {
        'NSMicrophoneUsageDescription': 'Need microphone access for XYZ purpose',
    }
}

Closing this issue.