You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/20 05:03:58 UTC

[GitHub] [cordova-plugin-media-capture] hemachandsai commented on issue #156: image capture not working in android

hemachandsai commented on issue #156: image capture not working in android
URL: https://github.com/apache/cordova-plugin-media-capture/issues/156#issuecomment-555839305
 
 
   cordova-android:@8.0.0
    cordova-common@3.2.0
   cordova-plugin-media-capture version@3.0.3
   androidversion@9
   
   `      navigator.device.capture.captureImage(image => {
           let win: any = window;
           win.resolveLocalFileSystemURL(
             image[0].fullPath,
             fileEntry => {
               fileEntry.file(
                 file => {
                   let data = new FileReader();
                   data.onloadend = () => {
                     console.log(data.result);
                     let blob = new Blob([data.result]);
                     this.kycData[code].httpCall = true;
                     this.cd.detectChanges();
                     this.kycService
                       .uploadKyc(type, blob, image[0].name)
                       .subscribe(
                         (res: any) => {
                           if (res.status) {
                             this.processUpload(code);
                           }
                         },
                         err => {
                           err.status === 0
                             ? this.presentToast("Please Check your Connection")
                             : this.presentToast(
                                 typeof err.error === "string"
                                   ? err.error
                                   : err.error.message
                               );
                           console.log(err);
                         }
                       )
                       .add(() => {
                         this.kycData[code].httpCall = false;
                         this.cd.detectChanges();
                       });
                   };
                   data.readAsArrayBuffer(file);
                 },
                 err => {
                   console.log(err);
                 }
               );
             },
             err => {
               console.log(err);
             }
           );
         }, (err) => {
           console.log(err)
         });`
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org