CB-13264 (iOS): Remove ios usage descriptions

This closes #295
This commit is contained in:
Julio César 2017-10-14 23:34:12 +02:00
parent a6706aef5f
commit 9f480b10cb
3 changed files with 42 additions and 36 deletions

View File

@ -76,23 +76,33 @@ Documentation consists of template and API docs produced from the plugin JS code
### iOS Quirks ### iOS Quirks
Since iOS 10 it's mandatory to add a `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription` 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 users camera. This plugins requires the following usage descriptions:
- `NSCameraUsageDescription` describes the reason that the app accesses the user's camera.
- `NSPhotoLibraryUsageDescription` describes the reason the app accesses the user's photo library. - `NSPhotoLibraryUsageDescription` describes the reason the app accesses the user's photo library.
- `NSLocationWhenInUseUsageDescription` describes the reason the app accesses the user's location. (Set it if you have `CameraUsesGeolocation` preference set to `true`)
When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add these entries into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:
To add this entry you can pass the following variables on plugin install. ```
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
```
- `CAMERA_USAGE_DESCRIPTION` for `NSCameraUsageDescription` ```
- `PHOTOLIBRARY_USAGE_DESCRIPTION` for `NSPhotoLibraryUsageDescription` <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
```
Example: ```
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message" <string>need location access to find things nearby</string>
</edit-config>
If you don't pass the variable, the plugin will add an empty string as value. ```
--- ---

View File

@ -18,23 +18,33 @@ the system's image library.
### iOS Quirks ### iOS Quirks
Since iOS 10 it's mandatory to add a `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription` 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 users camera. This plugins requires the following usage descriptions:
- `NSCameraUsageDescription` describes the reason that the app accesses the user's camera.
- `NSPhotoLibraryUsageDescription` describes the reason the app accesses the user's photo library. - `NSPhotoLibraryUsageDescription` describes the reason the app accesses the user's photo library.
- `NSLocationWhenInUseUsageDescription` describes the reason the app accesses the user's location. (Set it if you have `CameraUsesGeolocation` preference set to `true`)
When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add these entries into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:
To add this entry you can pass the following variables on plugin install. ```
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
```
- `CAMERA_USAGE_DESCRIPTION` for `NSCameraUsageDescription` ```
- `PHOTOLIBRARY_USAGE_DESCRIPTION` for `NSPhotoLibraryUsageDescription` <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
```
Example: ```
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message" <string>need location access to find things nearby</string>
</edit-config>
If you don't pass the variable, the plugin will add an empty string as value. ```
--- ---

View File

@ -167,20 +167,6 @@
<framework src="CoreGraphics.framework" /> <framework src="CoreGraphics.framework" />
<framework src="AVFoundation.framework" /> <framework src="AVFoundation.framework" />
<preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>$CAMERA_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>
<config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
<string></string>
</config-file>
</platform> </platform>
<!-- blackberry10 --> <!-- blackberry10 -->