You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/06/16 00:43:57 UTC

[GitHub] [cordova-plugin-camera] willnix86 opened a new issue #462: Screen flashes white on function call, and "discovery" error

willnix86 opened a new issue #462: Screen flashes white on function call, and "discovery" error
URL: https://github.com/apache/cordova-plugin-camera/issues/462
 
 
   # Bug Report
   
   ## Problem
   
   When I fire off the function to select an image from the camera roll, the device screen flashes white and pauses slightly before opening the camera roll.
   
   The pause is less with each press, but the flashing white screen still occurs - judging by my console logs, whenever I fire off the getCamera function, the app is being re-initialized (see screenshot - 'Open DB' should only be happening on app init.
   
   The camera roll does load, but when I select an image, I receive the following error:
   
   [discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
   
   Initially, I wasn't receiving a permissions request for the camera roll so I had to wrap the function in a cordova.diagnostic request function, so now I KNOW permission to access the camera roll is granted.
   
   ### What is expected to happen?
   
   The camera roll prompt loads without a visual error and I can access the picture in the functions success callback.
   
   ### What does actually happen?
   
   See problem above ^^^
   
   ## Information
   Happens on both emulated and physical devices
   
   ### Command or Code
   handleCameraRollPermission is fired from an onClick event
   
   function handleCameraRollPermission() {
     window.cordova.plugins.diagnostic.getCameraRollAuthorizationStatus(status => {
       switch (status) {
         case window.cordova.plugins.diagnostic.permissionStatus.NOT_REQUESTED:
           window.cordova.plugins.diagnostic.requestCameraRollAuthorization(status => 
             status === window.cordova.plugins.diagnostic.permissionStatus.GRANTED &&
               addImage(), 
             err => console.log('Camera roll request error ' + err));
           break;
         case window.cordova.plugins.diagnostic.permissionStatus.DENIED:
             console.log("Permission denied");
             break;
         case window.cordova.plugins.diagnostic.permissionStatus.GRANTED:
             addImage();
             break;
         default:
           break;
       } 
     }, function(error){
         console.error("The following error occurred: "+error);
     });
   }
   
   function addImage() {
     navigator.camera.getPicture(imageURI => {
       console.log(imageURI);
     }, err => {
       console.log(err);
     }, {
       sourceType: window.Camera.PictureSourceType.PHOTOLIBRARY
     });
   }
   
   ### Environment, Platform, Device
   Physical iPhone 6s - iOS 12.4
   Simulated iPhone Xr - iOS 12.2
   
   ### Version information
   "cordova-android": "^8.0.0",
   "cordova-android-firebase-gradle-release": "^3.0.0",
   "cordova-android-play-services-gradle-release": "^3.0.0",
   "cordova-browser": "^6.0.0",
   "cordova-custom-config": "^5.1.0",
   "cordova-ios": "^5.0.1",
   "cordova-plugin-camera": "^4.0.3",
   "cordova-plugin-device": "^2.0.2",
   "cordova-plugin-whitelist": "^1.3.3",
   "cordova-plugin-wkwebview-engine": "^1.1.4",
    "cordova-sqlite-storage": "3.2.0",
   "cordova.plugins.diagnostic": "4.0.12",
   "react": "^16.8.6"
   
   Xcode 10.2.1
   Mac OS X Mojave
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] I searched for existing GitHub issues
   - [x ] I updated all Cordova tooling to most recent version
   - [x ] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org