pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 587 forks source link

It‘s incompatible with cordova-plugin-telerik-imagepicker #249

Open HSone opened 5 years ago

HSone commented 5 years ago

in android When I execute ionic cordova plugin add cordova-plugin-file-opener2,the imagepicker Open Album Function become flashback,

Does anybody know what the problem is?

shnist commented 5 years ago

hi @HSone, thanks for raising this issue. In order to assist you better can you please let me know the following:

1) What version of the file opener plugin are you using 2) What version of the cordova-plugin-telerik-imagepicker 3) I don't see an "open album" method on the plugin, are you using this one? https://github.com/Telerik-Verified-Plugins/ImagePicker 4) Can you copy and paste the output of cordova info for me please

Thanks

HSone commented 5 years ago

"cordova-plugin-telerik-imagepicker" spec="^2.2.1" "cordova-plugin-file-opener2" spec="^2.1.4" Before install cordova-plugin-file-opener2,it works normally.But now,console“Invalid output type option entered. Defaulting to FILE_URI. Please use window.imagePicker.OutputType.FILE_URI or window.imagePicker.OutputType.BASE64_STRING”。

shnist commented 5 years ago

thanks @HSone, i'll take a look.

shnist commented 5 years ago

@HSone can you please provide a snippet of the code you are running? I've not been able to reproduce the error you're seeing.

HSone commented 5 years ago

@shnist ,sorry,i response slow. In order to make you understand my problem better.I did a test, built a new project.Just do the following steps: 1、ionic cordova plugin add cordova-plugin-telerik-imagepicker npm install @ionic-native/image-picker 2、ionic cordova plugin add cordova-plugin-file-opener2 npm install @ionic-native/file-opener 3、ionic cordova platform add android ionic cordova run android The page.ts like this: import { Component } from '@angular/core'; import { NavController } from '@ionic/angular'; import { ImagePicker, ImagePickerOptions } from '@ionic-native/image-picker/ngx'; import { FileOpener } from '@ionic-native/file-opener/ngx'; @component({ selector: 'app-tab1', templateUrl: 'tab1.page.html', styleUrls: ['tab1.page.scss'] }) export class Tab1Page { path = ""; constructor(public navCtrl: NavController, public imagePicker: ImagePicker, private fileOpener: FileOpener) { } ionViewDidLoad() { } imgPick() { var options: ImagePickerOptions = { maximumImagesCount: 1, quality: 100, outputType: 2 }; this.imagePicker.getPictures(options).then((results) => { console.log(results[0]); this.path = results[0]; }) } look() { this.fileOpener.open(this.path, 'image/png') .then(() => console.log('File is opened')) .catch(e => console.log('Error opening file', e)); } } The file-opener is normal work,but the imagepicker is flashback before get into mobile album.And, if i didn't operate the second step,the imagepicker is normally worked. After that,I had changed the file-opener version like @2.1.2 @2.1.4 @2.2.0,but it's still not work. Thank you very much for your help.