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
Copy file name to clipboardExpand all lines: README.md
+36-15Lines changed: 36 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,31 +17,52 @@ This native Node.js module allows you to manage an app's access to:
17
17
* Camera
18
18
* Microphone
19
19
* Accessibility
20
+
* Location
20
21
21
22
## API
22
23
23
24
## `permissions.getAuthStatus(type)`
24
25
25
-
*`type` String - The type of system component to which you are requesting access. Can be one of 'contacts', 'full-disk-access', 'photos', 'reminders', 'camera', 'accessibility', 'microphone', or 'calendar'.
26
+
*`type` String - The type of system component to which you are requesting access. Can be one of `accessibility`, `calendar`, `camera`, `contacts`, `full-disk-access`, `location`, `microphone`, `photos`, or `reminders`.
26
27
27
-
Returns `String` - Can be one of 'not determined', 'denied', 'authorized', or 'restricted'.
28
+
Returns `String` - Can be one of `not determined`, `denied`, `authorized`, or `restricted`.
28
29
29
30
Checks the authorization status of the application to access `type` on macOS.
30
31
31
32
Return Value Descriptions:
32
-
*'not determined' - The user has not yet made a choice regarding whether the application may access `type` data.
33
-
*'restricted' - The application is not authorized to access `type` data. The user cannot change this application’s status, possibly due to active restrictions such as parental controls being in place.
34
-
*'denied' - The user explicitly denied access to `type` data for the application.
35
-
*'authorized' - The application is authorized to access `type` data.
33
+
*`not determined` - The user has not yet made a choice regarding whether the application may access `type` data.
34
+
*`restricted` - The application is not authorized to access `type` data. The user cannot change this application’s status, possibly due to active restrictions such as parental controls being in place.
35
+
*`denied` - The user explicitly denied access to `type` data for the application.
36
+
*`authorized` - The application is authorized to access `type` data.
36
37
37
38
**Notes:**
38
-
* Access to 'contacts' will always return a status of 'Authorized' prior to macOS 10.11, as access to contacts was unilaterally allowed until that version.
39
-
* Access to 'camera' and 'microphone' will always return a status of 'Authorized' prior to macOS 10.14, as access to contacts was unilaterally allowed until that version.
39
+
* Access to `contacts` will always return a status of `authorized` prior to macOS 10.11, as access to contacts was unilaterally allowed until that version.
40
+
* Access to `camera` and `microphone` will always return a status of `authorized` prior to macOS 10.14, as access to contacts was unilaterally allowed until that version.
*`status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
65
+
*`status` String - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
45
66
46
67
Your app’s `Info.plist` file must provide a value for the `NSContactsUsageDescription` key that explains to the user why your app is requesting Contacts access.
47
68
@@ -50,7 +71,7 @@ Your app’s `Info.plist` file must provide a value for the `NSContactsUsageDesc
50
71
<string>Your reason for wanting to access the Contact store</string>
51
72
```
52
73
53
-
**Note:**`status` will be called back as 'authorized' prior to macOS 10.11, as access to contacts was unilaterally allowed until that version.
74
+
**Note:**`status` will be called back as `authorized` prior to macOS 10.11, as access to contacts was unilaterally allowed until that version.
*`type` String - The type of media to which you are requesting access. Can be 'microphone' or 'camera'.
126
+
*`type` String - The type of media to which you are requesting access. Can be `microphone` or `camera`.
106
127
107
128
*`callback` Function
108
-
*`status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
129
+
*`status` String - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
109
130
110
131
Your app must provide an explanation for its use of capture devices using the `NSCameraUsageDescription` or `NSMicrophoneUsageDescription``Info.plist` keys; Calling this method or attempting to start a capture session without a usage description raises an exception.
111
132
@@ -116,7 +137,7 @@ Your app must provide an explanation for its use of capture devices using the `N
116
137
<string>Your reason for wanting to access the Microphone</string>
117
138
```
118
139
119
-
**Note:**`status` will be called back as 'authorized' prior to macOS 10.14 High Sierra, as access to the camera and microphone was unilaterally allowed until that version.
140
+
**Note:**`status` will be called back as `authorized` prior to macOS 10.14 High Sierra, as access to the camera and microphone was unilaterally allowed until that version.
0 commit comments