Skip to content

Commit 5fe7b78

Browse files
author
Yonah Forst
committed
* 'master' of https://github.com/joshblour/react-native-permissions: Add AppStore submission disclaimer Fix markdonw syntax
2 parents f54d001 + a1a6ba8 commit 5fe7b78

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

README.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The current supported permissions are:
2121
| 0.2.5 | 0.33.0 - 0.39.0 |
2222
*Complies with [react-native-version-support-table](https://github.com/dangnelson/react-native-version-support-table)*
2323

24-
##General Usage
24+
## General Usage
2525
```
2626
npm install --save react-native-permissions
2727
rnpm link
@@ -85,9 +85,9 @@ const Permissions = require('react-native-permissions');
8585
//...
8686
```
8787

88-
##API
88+
## API
8989

90-
###Permission statuses
90+
### Permission statuses
9191
Promises resolve into one of these statuses
9292

9393
| Return value | Notes|
@@ -97,7 +97,7 @@ Promises resolve into one of these statuses
9797
|`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. |
9898
|`undetermined`| user has not yet been prompted with a permission dialog |
9999

100-
###Supported permission types
100+
### Supported permission types
101101

102102
| Name | iOS | Android |
103103
|---|---|---|
@@ -114,7 +114,7 @@ Promises resolve into one of these statuses
114114
|`speechRecognition`| ✔️ ||
115115
|`storage`| ❌️ ||
116116

117-
###Methods
117+
### Methods
118118
| Method Name | Arguments | Notes
119119
|---|---|---|
120120
| `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
124124
| `openSettings` | *none* | - Switches the user to the settings page of your app (iOS 8.0 and later) |
125125
| `canOpenSettings` | *none* | - Returns a boolean indicating if the device supports switching to the settings page |
126126

127-
###iOS Notes
127+
### iOS Notes
128128
Permission type `bluetooth` represents the status of the `CBPeripheralManager`. Don't use this if only need `CBCentralManager`
129129

130130
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:
157157
If you need Contacts permission you have to add the key "Privacy - Contacts Usage Description".
158158
<img width="338" alt="3cde3b44-7ffd-11e6-918b-63888e33f983" src="https://cloud.githubusercontent.com/assets/1440796/18713019/271be540-8011-11e6-87fb-c3828c172dfc.png">
159159

160-
###Android Notes
160+
### Android Notes
161161

162162
Requires RN >= 0.29.0
163163

@@ -177,22 +177,22 @@ Here's a map of types to Android system permissions names:
177177

178178
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
179179

180-
##Setup
180+
## Setup
181181

182182
````
183183
npm install --save react-native-permissions
184184
rnpm link
185185
````
186186

187-
###Or manualy linking
187+
### Or manualy linking
188188

189-
####iOS
189+
#### iOS
190190
* Run open node_modules/react-native-permissions
191191
* Drag ReactNativePermissions.xcodeproj into the Libraries group of your app's Xcode project
192192
* Add libReactNativePermissions.a to `Build Phases -> Link Binary With Libraries.
193193

194-
####Android
195-
#####Step 1 - Update Gradle Settings
194+
#### Android
195+
##### Step 1 - Update Gradle Settings
196196

197197
```
198198
// file: android/settings.gradle
@@ -201,7 +201,7 @@ rnpm link
201201
include ':react-native-permissions'
202202
project(':react-native-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-permissions/android')
203203
```
204-
#####Step 2 - Update Gradle Build
204+
##### Step 2 - Update Gradle Build
205205

206206
```
207207
// file: android/app/build.gradle
@@ -212,7 +212,7 @@ dependencies {
212212
compile project(':react-native-permissions')
213213
}
214214
```
215-
#####Step 3 - Register React Package
215+
##### Step 3 - Register React Package
216216
```
217217
...
218218
import com.joshblour.reactnativepermissions.ReactNativePermissionsPackage; // <--- import
@@ -232,8 +232,34 @@ public class MainApplication extends Application implements ReactApplication {
232232
...
233233
}
234234
```
235+
## AppStore submission disclaimer
235236

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
237263

238264
#### Q: Android - `undefined is not a object (evaluating 'RNPermissions.requestPermissions')`
239265
A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked

0 commit comments

Comments
 (0)