5 Replies Latest reply on Nov 12, 2017 7:20 AM by bitsw33803128

    camera permissions not working but plugin recognized

    travolto

      this is my config.xml

      the plugin is loaded by phonegap but when i install the APK debug or release it doesn't ask me for camera permissions. Whats going on?

       

      <plugin name="cordova-plugin-dialogs" spec="1.3.2" source="npm" />

      <plugin name="cordova-plugin-file" spec="4.3.2" source="npm"  />
      <plugin name="cordova-plugin-file-transfer" spec="1.6.2" source="npm"  />
      <plugin name="cordova-plugin-geolocation" spec="2.4.2" source="npm"  />
      <plugin name="cordova-plugin-whitelist" spec="1.3.2" source="npm"  />
      <plugin name="cordova-plugin-camera" spec="2.4.0" source="npm" />

       

       

      <feature name="http://api.phonegap.com/1.0/file"/>

          <feature name="http://api.phonegap.com/1.0/geolocation"/>

          <feature name="http://api.phonegap.com/1.0/network"/>

      <feature name="http://api.phonegap.com/1.0/camera"/>

       

       

          <preference name="permissions"                value="none" />

      <preference name="stay-in-webview"            value="false" />
      <preference name="InAppBrowserStorageEnabled" value="true"/>
        • 1. Re: camera permissions not working but plugin recognized
          joe_bowser Adobe Employee (Admin)

          Does the camera just work, or is it also failing? Can you clarify what the actual behaviour is that you're expecting?

          • 2. Re: camera permissions not working but plugin recognized
            travolto Level 1

            First i would think that the apk install would request camera permissions

            right during installation. The camera feature from the plugin is not

            available then from within the app. Its undefined even when i wait for

            ondeviceready etc.

            • 3. Re: camera permissions not working but plugin recognized
              joe_bowser Adobe Employee (Admin)

              First of all, it depends on what version of Android you're testing on.  Android 7 will not request the permission until the Camera is actually accessed by the API.  It sounds like you have a Javascript problem that's preventing you from getting the Camera to work properly, since you're not able to even get the camera to load.  We would have to get more information regarding the device, and what errors you are getting in the Javascript console when you load the application to get a better idea of what's going on.

              • 4. Re: camera permissions not working but plugin recognized
                travolto Level 1

                Android 6. Like i said.. Other apps do ask for permission of camera during

                install. So the problem is sooner

                • 5. Re: camera permissions not working but plugin recognized
                  bitsw33803128 Level 1

                  I have similar problem. Camera and all plugin was working yesterday.

                  But today after recent build, it is just not working.  Seems permission is not there.

                   

                  Tested with both recent android and old device.

                   

                  Here is the config.xml

                  -----------------------------------------------

                     <!-- Customize your app and platform with the preference element. -->

                      <preference name="orientation"                value="default" />

                      <preference name="target-device"              value="universal" />

                      <preference name="fullscreen"                 value="false" />

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

                      <preference name="prerendered-icon"           value="true" />

                      <preference name="stay-in-webview"            value="false" />

                      <preference name="ios-statusbarstyle"         value="black-opaque" />

                      <preference name="detect-data-types"          value="true" />

                      <preference name="exit-on-suspend"            value="false" />

                      <preference name="show-splash-screen-spinner" value="true" />       

                      <preference name="auto-hide-splash-screen"    value="true" />

                      <preference name="disable-cursor"             value="false" />

                      <preference name="android-installLocation"    value="auto" />

                      <!--

                          Define a specific version of PhoneGap to build into your app.

                          <preference name="phonegap-version"       value="3.5.0" />

                      -->

                     

                      <!-- Plugins -->

                   

                      <!-- Core plugins -->

                      <plugin name="cordova-plugin-battery-status" />

                      <plugin name="cordova-plugin-camera" />

                      <plugin name="cordova-plugin-media-capture" />

                      <plugin name="cordova-plugin-console" />

                      <plugin name="cordova-plugin-contacts" />

                      <plugin name="cordova-plugin-device" />

                      <plugin name="cordova-plugin-device-motion" />

                      <plugin name="cordova-plugin-device-orientation" />

                      <plugin name="cordova-plugin-dialogs" />

                      <plugin name="cordova-plugin-file" version="4.3.3"/>

                      <plugin name="cordova-plugin-file-transfer" version="1.6.3" />

                      <plugin name="cordova-plugin-geolocation" />

                      <plugin name="cordova-plugin-globalization" />

                      <plugin name="cordova-plugin-inappbrowser" />

                      <plugin name="cordova-plugin-media" />

                      <plugin name="cordova-plugin-network-information" />

                      <plugin name="cordova-plugin-splashscreen" />

                      <plugin name="cordova-plugin-vibration" />

                   

                      <!-- Third party plugins -->

                      <!-- A list of available plugins are available at https://build.phonegap.com/plugins -->

                      <!--

                          <plugin name="com.phonegap.plugins.barcodescanner" />

                      -->

                   

                      <!-- Define app icon for each platform. -->

                      <icon src="icon.png" />

                      <icon src="res/icon/android/icon-36-ldpi.png"   gap:platform="android"    gap:qualifier="ldpi" />

                      <icon src="res/icon/android/icon-48-mdpi.png"   gap:platform="android"    gap:qualifier="mdpi" />

                      <icon src="res/icon/android/icon-72-hdpi.png"   gap:platform="android"    gap:qualifier="hdpi" />

                      <icon src="res/icon/android/icon-96-xhdpi.png"  gap:platform="android"    gap:qualifier="xhdpi" />

                      <icon src="res/icon/blackberry/icon-80.png"     gap:platform="blackberry" />

                      <icon src="res/icon/blackberry/icon-80.png"     gap:platform="blackberry" gap:state="hover"/>

                      <icon src="res/icon/ios/icon-57.png"            gap:platform="ios"        width="57" height="57" />

                      <icon src="res/icon/ios/icon-72.png"            gap:platform="ios"        width="72" height="72" />

                      <icon src="res/icon/ios/icon-57-2x.png"         gap:platform="ios"        width="114" height="114" />

                      <icon src="res/icon/ios/icon-72-2x.png"         gap:platform="ios"        width="144" height="144" />

                      <icon src="res/icon/webos/icon-64.png"          gap:platform="webos" />

                      <icon src="res/icon/windows-phone/icon-48.png"  gap:platform="winphone" />

                      <icon src="res/icon/windows-phone/icon-173.png" gap:platform="winphone"   gap:role="background" />

                   

                      <!-- Define app splash screen for each platform. -->

                      <gap:splash src="res/screen/android/screen-ldpi-portrait.png"       gap:platform="android" gap:qualifier="port-ldpi" />

                      <gap:splash src="res/screen/android/screen-mdpi-portrait.png"       gap:platform="android" gap:qualifier="port-mdpi" />

                      <gap:splash src="res/screen/android/screen-hdpi-portrait.png"       gap:platform="android" gap:qualifier="port-hdpi" />

                      <gap:splash src="res/screen/android/screen-xhdpi-portrait.png"      gap:platform="android" gap:qualifier="port-xhdpi" />

                      <gap:splash src="res/screen/blackberry/screen-225.png"              gap:platform="blackberry" />

                      <gap:splash src="res/screen/ios/screen-iphone-portrait.png"         gap:platform="ios"     width="320" height="480" />

                      <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png"      gap:platform="ios"     width="640" height="960" />

                      <gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios"     width="640" height="1136" />

                      <gap:splash src="res/screen/ios/screen-ipad-portrait.png"           gap:platform="ios"     width="768" height="1024" />

                      <gap:splash src="res/screen/ios/screen-ipad-landscape.png"          gap:platform="ios"     width="1024" height="768" />

                      <gap:splash src="res/screen/windows-phone/screen-portrait.jpg"      gap:platform="winphone" />

                   

                      <gap:config-file platform="ios" parent="CFBundleShortVersionString">

                      <string>100</string>

                      </gap:config-file>

                   

                   

                      <access origin="*"/>

                      <!-- Added the following intents to support the removal of whitelist code from base cordova to a plugin -->

                      <!-- Whitelist configuration. Refer to https://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html -->

                      <plugin name="cordova-plugin-whitelist" version="1" />

                      <allow-intent href="http://*/*" />

                      <allow-intent href="https://*/*" />

                      <allow-intent href="tel:*" />

                      <allow-intent href="sms:*" />

                      <allow-intent href="mailto:*" />

                      <allow-intent href="geo:*" />

                      <platform name="android">

                          <allow-intent href="market:*" />

                      </platform>

                      <platform name="ios">

                          <allow-intent href="itms:*" />

                          <allow-intent href="itms-apps:*" />

                      </platform>

                   

                  ----------------------------------------------