tskravisankar opened a new issue #614:
URL: https://github.com/apache/cordova-plugin-camera/issues/614


   # Bug Report
   
   
   ## Problem
   
   Gallery popover is not visible when upload is clicked on iPad after 
capacitor migration. It works on iPhone devices.
   
   ### What is expected to happen?
   
   When upload is clicked, gallery popover need to get display on iPad. It 
works fine on iPhone.
   
   ### What does actually happen?
   
   iPad:
   When upload is clicked, this.camera.getPicture() gets hit. After that no 
response. No error log also found. App doesn't got crashed as well. 
   
   Note:
   When the same process is done on iPhone, it shows gallery options.
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   
   Platform:
   Ionic, iOS
   
   We have migrated our ionic application to capacitor. Before migration, 
cordova plugin camera shows gallery option on both iPhone and iPad. Once it is 
migrated to capacitor, it shows gallery option only on iPhone. But it is not 
showing gallery popover on iPad. There is no difference in code level. On both 
devices, it hits the same method. But on iPad, it doesn't show the gallery 
popover.
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   step 1:
   ionic start cameraApp blank --capacitor
   cd cameraApp
   
   step2: (https://ionicframework.com/docs/native/camera)
   npm install cordova-plugin-camera
   npm install @ionic-native/camera
   ionic cap sync
   
   step3:
   Use this code in home:
   import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
   
   constructor(private camera: Camera) { }
   
   ...
   
   upload()
   {
   const options: CameraOptions = {
    quality: 100,
    destinationType: this.camera.DestinationType.FILE_URI,
    sourceType: this.camera.PictureSourceType.SAVEDPHOTOALBUM,
    mediaType: this.camera.MediaType.VIDEO
   }
   
   this.camera.getPicture(options).then((imageData) => {
   alert(imageData);
   }, (err) => {
   // Handle error
   });
   }
   
   step 4:
   add normal ionic button and call the upload method
   
   step 5:
   ionic build
   npx cap sync ios
   npx cap open ios
   
   step 5:
   Run in simulator -> iPhone
   Run in simulator -> iPad
   
   In iPhone, gallery popover will get open
   In iPad, gallery popover is not opening
   
   Note:
   Also tried multiple combinations on cameraoptions. Nothing works on iPad.
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   
   Platform:
   iOS
   
   Able to reproduce in simulator itself.
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   Version of cordova plugin camera:
   cordova-plugin-camera: 4.1.0
   @ionic-native/camera: ^5.26.0 (or)  4.7.0 (tried these versions)
   
   
   ## 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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to