|
|
|
|
24
|
rnpm link
|
24
|
rnpm link
|
25
|
```
|
25
|
```
|
26
|
|
26
|
|
|
|
27
|
+Add permissions to manifest for android and info.plist for ios (xcode >=8). See notes below for more details.
|
|
|
28
|
+
|
27
|
```js
|
29
|
```js
|
28
|
const Permissions = require('react-native-permissions');
|
30
|
const Permissions = require('react-native-permissions');
|
29
|
|
31
|
|
|
|
|
|
136
|
})
|
138
|
})
|
137
|
```
|
139
|
```
|
138
|
|
140
|
|
|
|
141
|
+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.
|
|
|
142
|
+
|
|
|
143
|
+Example:
|
|
|
144
|
+If you need Contacts permission you have to add the key "Privacy - Contacts Usage Description".
|
|
|
145
|
+<img width="338" alt="3cde3b44-7ffd-11e6-918b-63888e33f983" src="https://cloud.githubusercontent.com/assets/1440796/18713019/271be540-8011-11e6-87fb-c3828c172dfc.png">
|
|
|
146
|
+
|
139
|
###Android Notes
|
147
|
###Android Notes
|
140
|
|
148
|
|
141
|
Requires RN >= 0.29.0
|
149
|
Requires RN >= 0.29.0
|
|
|
|
|
214
|
|
222
|
|
215
|
#### Q: Android - `undefined is not a object (evaluating 'RNPermissions.requestPermissions')`
|
223
|
#### Q: Android - `undefined is not a object (evaluating 'RNPermissions.requestPermissions')`
|
216
|
A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
|
224
|
A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
|
|
|
225
|
+
|
|
|
226
|
+#### Q: iOS - app crashes as soon as I request permission
|
|
|
227
|
+A: starting with xcode 8, you need to add permission descriptions. see iOS notes for more details. Thanks to @jesperlndk for discovering this.
|