Skip to content

Commit

Permalink
fix(ios): Make NSCameraUsageDescription string non-empty, which is no…
Browse files Browse the repository at this point in the history
…w rejected by Apple

When iOS 10 came out of beta, iTunes Connect started rejecting apps submitted with empty

NSCameraUsageDescription strings. This adds back a good default.
  • Loading branch information
bitjson committed Oct 1, 2016
1 parent 20d8009 commit 514a2d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<header-file src="src/ios/QRScanner-Bridging-Header.h" />
<source-file src="src/ios/QRScanner.swift"/>
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string></string>
<string>The camera is used to scan QR codes.</string>
</config-file>
</platform>

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The iOS component of the plugin is written in Swift 2.3. To enable it, be sure y
<platform name="ios">
<hook type="before_build" src="plugins/cordova-plugin-qrscanner/scripts/swift-support.js" />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>The camera is used to read QR codes.</string>
<string>The camera is used to scan QR codes.</string>
</config-file>
</platform>
```
Expand All @@ -102,7 +102,7 @@ npm install --save xcode

Swift will now be enabled during your build, and the `QRScanner` plugin will be available in your app.

Starting with iOS 10, the `NSCameraUsageDescription` string is also required to avoid a runtime exit. This field can be provided in a single language, localized using the `InfoPlist.strings` file, or simply left empty (`<string></string>`).
Starting with iOS 10, a non-empty `NSCameraUsageDescription` string is also required to avoid a runtime exit. This field can be provided in a single language or localized using the `InfoPlist.strings` file. (Note: Apps with an empty `NSCameraUsageDescription` will not exit at runtime, but are rejected by iTunes Connect when uploaded for distribution.)

#### Using multiple Cordova plugins written in Swift

Expand Down
2 changes: 1 addition & 1 deletion tests/project/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>The test app uses the camera to read QR codes.</string>
<string>The test app uses the camera to scan QR codes.</string>
</config-file>
</platform>
<plugin name="cordova-plugin-qrscanner" spec="../../cordova-plugin-qrscanner" />
Expand Down

0 comments on commit 514a2d2

Please sign in to comment.