6

I am using ionic 1 with cordova-plugin-camera 2.3.0. I am using latest version of cordova.

When I press button to get image whether to use camera or gallery ($cordovaCamera.getPicture) in ios 10, nothing happens. If I press home button and go back into the app, camera or gallery pops up right away.

I have already enabled the permission for it.

This is working perfect for ios 9 and below and all android versions.

Please help.

Kelvin
  • 2,218
  • 4
  • 22
  • 41
  • did you add **NSCameraUsageDescription** in info.plist file? – Naitik Nov 02 '16 at 07:01
  • Yes I installed the plugin with cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="We requires access to your camera" --save – Kelvin Nov 02 '16 at 07:18
  • 1
    I found the answer to this issue probably here: http://stackoverflow.com/questions/38410159/cordova-app-hanging-during-startup-on-ios-10-beta – Sven Sönnichsen Nov 05 '16 at 11:34

1 Answers1

4

I confirm this is solved in Cordova app hanging during startup on iOS 10 as Sven Sönnichsen indicated in the comment to the question.

Add gap://ready file: to the Content-Security-Policy meta tag in index.html.

<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; script-src &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos; *; style-src  &apos;self&apos; &apos;unsafe-inline&apos; *">

This was also addressed here: https://forums.adobe.com/thread/2211591 where Allsetra ICT said that changing the meta tag to this simple form also worked (although I did not verified it).

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
jcarballo
  • 27,395
  • 3
  • 28
  • 28