下面的代码在网络浏览器(普华永道)中打开图库,工作正常,但在Android设备上运行相同的图片库,它不会打开。请让我知道,如果我错过了什么。
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
async openCamera(){
if (this.imagesend.length <= 1) {
const image = await Camera.getPhoto({
quality: 90,
allowEditing: false,
correctOrientation: true,
resultType: CameraResultType.Base64,
source: CameraSource.Photos
});
this.imagesend.push(image.base64String);
this.base64Image.push("data:image/jpeg;base64," + image.base64String);
}
else{
let msg = "You can only upload two images.";
this.presentErrorToast(msg);
}
}
1条答案
按热度按时间zf2sa74q1#
抱歉,我忘记在AndroidManifest.xml中添加权限