Cordova camera not working

Hello,

do not get the Cordova camera plugin working.

Even the sample from AppStudio does not work.

Other plugins do work just fine (Barcode, …).

Config.xml:

When testing it on my iPhone (native app built using Volt.Builder) the app crashes when trying to access the camera.

Anyone having the same issue?

Or any idea for a solution?

Thank you!

Greetings,

Olaf

Android

Try adding this line to config.xml:

<preference name="AndroidInsecureFileModeEnabled" value="true" />

This is required due to a recent change that Google made.

iOS

Try adding these lines to config.xml:

<platform name="ios">
  <edit-config target="NSLocationAlwaysUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>Allow the app to know your location</string>
  </edit-config>
  <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>Allow the app to know your location</string>
  </edit-config>
  <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>App would like to access Camera to take picture of any document that you want to upload as attachment to your message</string>
  </edit-config>
  <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>Allow the app to open Photo Library to take picture of any document that you want to upload as attachment to your message</string>
  </edit-config>
</platform>

iOS now requires permissions in the app before you can use the camera.

These lines have been added to the sample in the next build.

…works perfect now!

Thank you very much!!!

Found it in the plugin description:

So, in the future, I know what to look for… :wink:

Great support, thx!!!