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
@@ -97,7 +97,7 @@ Promises resolve into one of these statuses
97
97
|`restricted`|*(iOS only)* 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. |
98
98
|`undetermined`| user has not yet been prompted with a permission dialog |
99
99
100
-
###Supported permission types
100
+
###Supported permission types
101
101
102
102
| Name | iOS | Android |
103
103
|---|---|---|
@@ -114,7 +114,7 @@ Promises resolve into one of these statuses
114
114
|`speechRecognition`| ✔️ | ❌ |
115
115
|`storage`| ❌️ | ✔ |
116
116
117
-
###Methods
117
+
###Methods
118
118
| Method Name | Arguments | Notes
119
119
|---|---|---|
120
120
|`getPermissionStatus`|`type`| - Returns a promise with the permission status. See iOS Notes for special cases |
@@ -124,7 +124,7 @@ Promises resolve into one of these statuses
124
124
|`openSettings`|*none*| - Switches the user to the settings page of your app (iOS 8.0 and later) |
125
125
|`canOpenSettings`|*none*| - Returns a boolean indicating if the device supports switching to the settings page |
126
126
127
-
###iOS Notes
127
+
###iOS Notes
128
128
Permission type `bluetooth` represents the status of the `CBPeripheralManager`. Don't use this if only need `CBCentralManager`
129
129
130
130
Permission type `location` accepts a second parameter for `requestPermission` and `getPermissionStatus`; the second parameter is a string, either `always` or `whenInUse`(default).
@@ -157,7 +157,7 @@ Example:
157
157
If you need Contacts permission you have to add the key "Privacy - Contacts Usage Description".
@@ -177,22 +177,22 @@ Here's a map of types to Android system permissions names:
177
177
178
178
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
179
179
180
-
##Setup
180
+
##Setup
181
181
182
182
````
183
183
npm install --save react-native-permissions
184
184
rnpm link
185
185
````
186
186
187
-
###Or manualy linking
187
+
###Or manualy linking
188
188
189
-
####iOS
189
+
####iOS
190
190
* Run open node_modules/react-native-permissions
191
191
* Drag ReactNativePermissions.xcodeproj into the Libraries group of your app's Xcode project
192
192
* Add libReactNativePermissions.a to `Build Phases -> Link Binary With Libraries.
193
193
194
-
####Android
195
-
#####Step 1 - Update Gradle Settings
194
+
####Android
195
+
#####Step 1 - Update Gradle Settings
196
196
197
197
```
198
198
// file: android/settings.gradle
@@ -201,7 +201,7 @@ rnpm link
201
201
include ':react-native-permissions'
202
202
project(':react-native-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-permissions/android')
@@ -232,8 +232,34 @@ public class MainApplication extends Application implements ReactApplication {
232
232
...
233
233
}
234
234
```
235
+
## AppStore submission disclaimer
235
236
236
-
##Troubleshooting
237
+
If you need to submit you application to the AppStore, you need to add to your `Info.plist` all `*UsageDescription` keys with a string value explaining to the user how the app uses this data. **Even if you don't use them**.
238
+
239
+
So before submitting your app to the `AppStore`, make sure that in your `Info.plist` you have the following keys:
240
+
241
+
```
242
+
243
+
<key>NSBluetoothPeripheralUsageDescription</key>
244
+
<string>Some description</string>
245
+
<key>NSCalendarsUsageDescription</key>
246
+
<string>Some description</string>
247
+
<key>NSCameraUsageDescription</key>
248
+
<string>Some description</string>
249
+
<key>NSLocationWhenInUseUsageDescription</key>
250
+
<string>Some description</string>
251
+
<key>NSPhotoLibraryUsageDescription</key>
252
+
<string>Some description</string>
253
+
254
+
```
255
+
256
+
This is required because during the phase of `processing` in the `AppStore` submission, the system detects that you app contains code to request the permission `X` but don't have the `UsageDescription` key and rejects the build.
257
+
258
+
> Please note that it will only be shown to the users the usage descriptions of the permissions you really require in your app.
259
+
260
+
You can find more informations about this issue in #46.
261
+
262
+
## Troubleshooting
237
263
238
264
#### Q: Android - `undefined is not a object (evaluating 'RNPermissions.requestPermissions')`
239
265
A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
0 commit comments