I have a problem when I want to get a photo from the gallery or directly from the camera when using the camera library, the problem only occurs on ipads and is that when I click the button of the image gallery it does not open and The camera button does not work either, as I mentioned this only happens on the ipad, on the other hand, in all android devices and in the iphone it works correctly, I send below the code used.
Button code:
<ion-row>
<ion-col class="content-btn-option">
<ion-button expand="full" color="secondary" class="btn-option" (click)="takepicture()"><ion-icon name="camera-outline"></ion-icon></ion-button>
<ion-button expand="full" color="secondary" class="btn-option" (click)="gallery()"><ion-icon name="image-outline"></ion-icon></ion-button>
</ion-col>
</ion-row>
Gallery and Camera functions:
takepicture(){
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.CAMERA
};
this.camera.getPicture(options)
.then((imageData) => {
this.image = 'data:image/jpeg;base64,' + imageData;
console.log(this.image);
}, (err) => {
console.log(err);
});
}
gallery(){
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY
};
this.camera.getPicture(options)
.then((imageData) => {
this.image = 'data:image/jpeg;base64,' + imageData;
console.log(this.image);
}, (err) => {
console.log(err);
});
}
I hope can you help me with this.
Regards.