Browse Source

More cleanup

Mathieu Acthernoene 7 years ago
parent
commit
04a94a2e12
No account linked to committer's email address
1 changed files with 14 additions and 21 deletions
  1. 14
    21
      README.md

+ 14
- 21
README.md View File

11
 
11
 
12
 ## ⚠️ Breaking changes in version 1.0.0
12
 ## ⚠️ Breaking changes in version 1.0.0
13
 - Now using React Native's own JS `PermissionsAndroid` module on Android, which is great because we no longer have to do any additional linking on Android
13
 - Now using React Native's own JS `PermissionsAndroid` module on Android, which is great because we no longer have to do any additional linking on Android
14
-- Updated API to be closer to RN's PermissionsAndroid
14
+- Updated API to be closer to React Native's PermissionsAndroid
15
 - Removed `openSettings()` support on Android (to stay linking-free). There are several NPM modules available for this
15
 - Removed `openSettings()` support on Android (to stay linking-free). There are several NPM modules available for this
16
 - `restricted` status now supported on Android, although it means something different than iOS
16
 - `restricted` status now supported on Android, although it means something different than iOS
17
 
17
 
19
 
19
 
20
 ```sh
20
 ```sh
21
 npm install --save react-native-permissions
21
 npm install --save react-native-permissions
22
-```
23
-
24
-**OR**
25
-
26
-```sh
22
+--- or ---
27
 yarn add react-native-permissions
23
 yarn add react-native-permissions
28
 ```
24
 ```
29
 
25
 
30
-*📌  Don't forget to add permissions to `AndroidManifest.xml` for android and `Info.plist` for iOS (Xcode >=8). See notes below for more details.*
26
+📌  Don't forget to add permissions to `AndroidManifest.xml` for android and `Info.plist` for iOS (Xcode >=8). See notes below for more details.
31
 
27
 
32
 ### Additional iOS setup
28
 ### Additional iOS setup
33
 
29
 
122
 
118
 
123
 | Return value | Notes|
119
 | Return value | Notes|
124
 |---|---|
120
 |---|---|
125
-|`authorized`| user has authorized this permission |
126
-|`denied`| user has denied this permission at least once. On iOS this means that the user will not be prompted again. Android users can be promted multiple times until they select 'Never ask me again'|
127
-|`restricted`| **iOS** - this means user is not able to grant this permission, either because it's not supported by the device or because it has been blocked by parental controls. **Android** - this means that the user has selected 'Never ask me again' while denying permission |
128
-|`undetermined`| user has not yet been prompted with a permission dialog |
121
+|`authorized`| User has authorized this permission |
122
+|`denied`| User has denied this permission at least once. On iOS this means that the user will not be prompted again. Android users can be promted multiple times until they select 'Never ask me again'|
123
+|`restricted`| **iOS only** - this means user is not able to grant this permission, either because it's not supported by the device or because it has been blocked by parental controls. **Android** - this means that the user has selected 'Never ask me again' while denying permission |
124
+|`undetermined`| User has not yet been prompted with a permission dialog |
129
 
125
 
130
 ### Supported permissions types
126
 ### Supported permissions types
131
 
127
 
187
 - With Xcode 8, you now need to add usage descriptions for each permission you will request. Open Xcode ➜ `Info.plist` ➜ Add a key (starting with "Privacy - ...") with your kit specific permission.
183
 - With Xcode 8, you now need to add usage descriptions for each permission you will request. Open Xcode ➜ `Info.plist` ➜ Add a key (starting with "Privacy - ...") with your kit specific permission.
188
 
184
 
189
 Example:
185
 Example:
190
-If you need Contacts permission you have to add the key "Privacy - Contacts Usage Description".
186
+If you need Contacts permission you have to add the key `Privacy - Contacts Usage Description`.
191
 
187
 
192
 <img width="338" alt="3cde3b44-7ffd-11e6-918b-63888e33f983" src="https://cloud.githubusercontent.com/assets/1440796/18713019/271be540-8011-11e6-87fb-c3828c172dfc.png">
188
 <img width="338" alt="3cde3b44-7ffd-11e6-918b-63888e33f983" src="https://cloud.githubusercontent.com/assets/1440796/18713019/271be540-8011-11e6-87fb-c3828c172dfc.png">
193
 
189
 
220
 
216
 
221
 ### Android Notes
217
 ### Android Notes
222
 
218
 
223
-Uses RN's own `PermissionsAndroid` JS api (http://facebook.github.io/react-native/releases/0.45/docs/permissionsandroid.html)
224
-
225
-All required permissions also need to be included in the `AndroidManifest.xml` file before they can be requested. Otherwise `request()` will immediately return `denied`.
226
-
227
-Permissions are automatically accepted for **targetSdkVersion < 23** but you can still use `check()` to check if the user has disabled them from Settings.
228
-
229
-You can request write access to any of these types by also including the appropriate write permission in the Manifest. Read more here: https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous
219
+- Uses React Native's own [`PermissionsAndroid` JS API](http://facebook.github.io/react-native/docs/permissionsandroid.html).
220
+- All required permissions also need to be included in the `AndroidManifest.xml` file before they can be requested. Otherwise `request()` will immediately return `denied`.
221
+- Permissions are automatically accepted for **targetSdkVersion < 23** but you can still use `check()` to check if the user has disabled them from Settings.
222
+- You can request write access to any of these types by also including the appropriate write permission in the `AndroidManifest.xml` file. Read more [here](https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous).
230
 
223
 
231
 ## Troubleshooting
224
 ## Troubleshooting
232
 
225
 
233
 #### Q: iOS - App crashes as soon as I request permission
226
 #### Q: iOS - App crashes as soon as I request permission
234
-A: starting with Xcode 8, you need to add permission descriptions. See iOS notes for more details. Thanks to [@jesperlndk](https://github.com/jesperlndk) for discovering this.
227
+> A: Starting with Xcode 8, you need to add permission descriptions. See iOS notes for more details. Thanks to [@jesperlndk](https://github.com/jesperlndk) for discovering this.
235
 
228
 
236
 #### Q: iOS - App crashes when I change permission from settings
229
 #### Q: iOS - App crashes when I change permission from settings
237
-A: This is normal. iOS restarts your app when your privacy settings change. Just google "iOS crash permission change"
230
+> A: This is normal. iOS restarts your app when your privacy settings change. Just google "iOS crash permission change"