简体   繁体   中英

Image not capturing from iPhone's browser in Ionic Cordova (Browser Platform)

I have installed below plugin https://github.com/Telerik-Verified-Plugins/ImagePicker

This plugin is working fine for android and ios app and also working for android browser but it's not working for any mobile browser of iPhone (IOS) only.

It opens camera on click of 'Take Photo' button but after click on 'Capture' button image not showing and error gives on console.

Unhandled Promise rejection: – "Missing Command Error" – "; Zone:" – "<root>" – "; Task:" – null – "; Value:" – "Missing Command Error" –
public ngOnInit(): void {
    this.cameraOptions = {
      quality: 50,
      sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
      destinationType: this.camera.DestinationType.DATA_URL,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    };
  }

  public selectFromGallery(): void {
    this.imagePicker.hasReadPermission().then(() => {
      this.imagePicker.getPictures({ ...this.cameraOptions, outputType: OutputType.DATA_URL, disable_popover: true }).then((results) => {
        if (results !== 'OK') {
          for (const result of results) {
            this.images.push(`data:image/jpeg;base64,${result}`);
          }
        }
      });
    });
  }

check this screenshot

So can you please help me with this issue?

It's not going to work. Cordova plugins do not work for the web.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM