0

I just built my iOS app with Meteor and Cordova and I get this crash report when I try to use a basic HTML "upload picture" form:

Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

Do you have any idea how to solve this? Especially with Cordova?

Almaju
  • 1,283
  • 12
  • 31

2 Answers2

6

This made it work for me:

meteor add cordova:cordova-custom-config@2.0.3

Then in your mobile-config.js file add the following section:

App.appendToConfig(`<platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
      <string>YOUR DESCRIPTION (PHOTOS PERMISSION) HERE</string>
    </config-file>
    <config-file platform="ios" target="*-Info.plist" parent="NSCameraUsageDescription">
      <string>YOUR DESCRIPTION (CAMERA PERMISSION) HERE</string>
    </config-file>
  </platform>`);

Source: https://forums.meteor.com/t/ios-10-compatibility/26065/46?u=almaju

Almaju
  • 1,283
  • 12
  • 31
  • Great solution, I had to edit the formatting though in order for it to work: App.appendToConfig(''); – oskare Aug 07 '17 at 09:37
1

See this answer for an example of what you need to provide:

https://stackoverflow.com/a/39476283/1226963

For Meteor you can't edit the config.xml file directly. For most items you can edit a mobile-config.js, but not this one.

Referencing another answer: Add entry to iOS .plist file via Cordova config.xml

You will see that there are two ways to achieve these entries, either by creating your own plugin and adding these entries to the config.xml file, or you can use the PlistBuddy utility inside a Cordova hook script to modify the *-Info.plist file.

Community
  • 1
  • 1
Mikkel
  • 7,693
  • 3
  • 17
  • 31