You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for checking and requesting Focus Status (Do Not Disturb)
authorization via INFocusStatusCenter, available since macOS 12.0.
New API:
- getAuthStatus('focus-status') - check current authorization
- askForFocusStatusAccess() - request authorization
@@ -38,6 +39,7 @@ This native Node.js module allows you to manage an app's access to:
38
39
- Calendar
39
40
- Camera
40
41
- Contacts
42
+
- Focus Status
41
43
- Full Disk Access
42
44
- Input Monitoring
43
45
- Location
@@ -60,7 +62,7 @@ If you're using macOS 12.3 or newer, you'll need to ensure you have Python insta
60
62
61
63
### `permissions.getAuthStatus(type)`
62
64
63
-
-`type` String - The type of system component to which you are requesting access. Can be one of `accessibility`, `bluetooth`, `calendar`, `camera`, `contacts`, `full-disk-access`, `input-monitoring`, `location`, `microphone`,`notifications`, `photos`, `reminders`, `screen`, or `speech-recognition`.
65
+
-`type` String - The type of system component to which you are requesting access. Can be one of `accessibility`, `bluetooth`, `calendar`, `camera`, `contacts`, `focus-status`, `full-disk-access`, `input-monitoring`, `location`, `microphone`,`notifications`, `photos`, `reminders`, `screen`, or `speech-recognition`.
64
66
65
67
Returns `String` - Can be one of `not determined`, `denied`, `authorized`, `limited`, `provisional`, or `restricted`.
66
68
@@ -84,6 +86,7 @@ const types = [
84
86
'calendar',
85
87
'camera',
86
88
'contacts',
89
+
'focus-status',
87
90
'full-disk-access',
88
91
'input-monitoring',
89
92
'location',
@@ -237,6 +240,28 @@ requesting Reminders access.
237
240
<string>Your reason for wanting access to read and write Reminders data.</string>
238
241
```
239
242
243
+
### `permissions.askForFocusStatusAccess()`
244
+
245
+
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized`, `denied`, `restricted`, or `not determined`.
246
+
247
+
Checks the authorization status for Focus Status access. If the status check returns:
248
+
249
+
-`not determined` - The Focus Status access authorization will prompt the user to authorize or deny. The Promise is resolved after the user selection.
250
+
-`denied` - The Promise is resolved as `denied`.
251
+
-`restricted` - The Promise is resolved as `restricted`.
252
+
253
+
**Note:** Requires macOS 12.0 or higher. On older versions, the Promise resolves as `not determined`.
0 commit comments