Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cordova plugin camera not showing gallery on iPad capacitor #3176

Closed
tskravisankar opened this issue Jun 30, 2020 · 1 comment · Fixed by #3177
Closed

bug: cordova plugin camera not showing gallery on iPad capacitor #3176

tskravisankar opened this issue Jun 30, 2020 · 1 comment · Fixed by #3177

Comments

@tskravisankar
Copy link

tskravisankar commented Jun 30, 2020

Bug Report

Capacitor Version

![image](https://user-images.githubusercontent.com/26854917/86087259-668a1000-bac1-11ea-8b3c-92b03fb9c95e.png)
![image](https://user-images.githubusercontent.com/26854917/86087285-77d31c80-bac1-11ea-979c-b86d9ff8e3c1.png)

Platform(s)

  • iOS -> iPad alone

Current Behavior

Gallery popover is not visible when upload is clicked on iPad after capacitor migration. It works on iPhone devices.

Expected Behavior

When upload is clicked, gallery popover need to get display on iPad. It works fine on iPhone.

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.

Code Reproduction

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.

Other Technical Details

npm --version output: 6.4.1

node --version output: v10.15.1

pod --version output (iOS issues only): 1.8.4

Version of cordova plugin camera:
cordova-plugin-camera: 4.1.0
@ionic-native/camera: ^5.26.0 (or) 4.7.0 (tried these versions)

Additional Context

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.

apache/cordova-plugin-camera#614

Actual Requirement:
We need to select video alone from gallery. For that, we have choose this plugin. It works fine on iPhone devices after migration. But not showing gallery popover on iPad devices.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant