Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get notified when perms are changed #10

Open
KishanBagaria opened this issue May 18, 2020 · 2 comments
Open

Get notified when perms are changed #10

KishanBagaria opened this issue May 18, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@KishanBagaria
Copy link
Contributor

Is it possible to get notified when a particular permission is granted by the user, manually from System Preferences or through the prompt?

@glawson
Copy link
Contributor

glawson commented May 21, 2020

@KishanBagaria - you can use getAuthStatus to poll for the status change.

@codebytere
Copy link
Owner

codebytere commented May 22, 2020

@KishanBagaria this is in theory possible using a similar approach to what's done in node-mac-contacts - i'd need to implement manual management of an EventEmitter since this isn't a class-based module. It might also be rather trickier because in this case we're needing to poll for a pretty wide range of notifications, each of which would need to be scaffolded up and torn down carefully to avoid leaks and crashes.

Like @glawson said you can for now poll with getAuthStatus() - i'd consider the event emission approach but it's gonna be a wild enough ride that i don't think i myself will have the cycles in the near future 🤔

@codebytere codebytere added enhancement New feature or request help wanted Extra attention is needed labels May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants