Skip to content
Permalink
Browse files
CB-13266 (ios): Remove ios usage descriptions
 This closes #83
  • Loading branch information
jcesarmobile committed Oct 21, 2017
1 parent af54359 commit 0634acbb66652d150b20f2f6cb835cf7af9eccba
Showing 2 changed files with 21 additions and 28 deletions.
@@ -200,26 +200,34 @@ object featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code.

### iOS Quirks

Since iOS 10 it's mandatory to add a `NSCameraUsageDescription`, `NSMicrophoneUsageDescription` and `NSPhotoLibraryUsageDescriptionentry` in the info.plist.
Since iOS 10 it's mandatory to provide an usage description in the `info.plist` if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description.

* `NSCameraUsageDescription` describes the reason that the app accesses the user’s camera.
* `NSMicrophoneUsageDescription` describes the reason that the app accesses the user’s microphone.
* `NSPhotoLibraryUsageDescriptionentry` describes the reason the app accesses the user's photo library.
This plugins requires the following usage descriptions:

When the system prompts the user to allow access, this string is displayed as part of the dialog box.
* `NSCameraUsageDescription` describes the reason the app accesses the user's camera.
* `NSMicrophoneUsageDescription` describes the reason the app accesses the user's microphone.
* `NSPhotoLibraryUsageDescriptionentry` describes the reason the app accesses the user's photo library.

To add this entry you can pass the following variables on plugin install.

* `CAMERA_USAGE_DESCRIPTION` for `NSCameraUsageDescription`
* `MICROPHONE_USAGE_DESCRIPTION` for `NSMicrophoneUsageDescription`
* `PHOTOLIBRARY_USAGE_DESCRIPTION` for `NSPhotoLibraryUsageDescriptionentry`
To add these entries into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:

-
Example:
```
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
```

`cordova plugin add cordova-plugin-media-capture --variable CAMERA_USAGE_DESCRIPTION="your usage message"`
```
<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
<string>need microphone access to record sounds</string>
</edit-config>
```

If you don't pass the variable, the plugin will add an empty string as value.
```
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
```

### Windows Phone 7 Quirks

@@ -149,21 +149,6 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"
<framework src="CoreGraphics.framework" />
<framework src="MobileCoreServices.framework" />

<preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>$CAMERA_USAGE_DESCRIPTION</string>
</config-file>

<preference name="MICROPHONE_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
<string>$MICROPHONE_USAGE_DESCRIPTION</string>
</config-file>

<preference name="PHOTOLIBRARY_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
<string>$PHOTOLIBRARY_USAGE_DESCRIPTION</string>
</config-file>

</platform>

<!-- blackberry10 -->

0 comments on commit 0634acb

Please sign in to comment.