giandifra / simple_share

A Flutter plugin for share image, video or file
MIT License
18 stars 15 forks source link

unsupported file type for PDF file #2

Closed masbenx closed 5 years ago

masbenx commented 5 years ago

Hi, I've got a problem when I try to share a pdf file, I've got 'Unsupported file type' message.

Here the source code that I used

if (await _file.exists()) { final uri = Uri.file(_file.path); if (uri != null) { SimpleShare.share( uri: uri.toString(), title: this.widget.perihal, msg: this.widget.perihal, type: "application/pdf"); } }

giandifra commented 5 years ago

You are in Android or iOS? I tried you code, in Android work fine, can you try with another file taked with file_picker ? thanks for you collaboration

masbenx commented 5 years ago

I'm on android.

but it already fixed. the problem is we need to add the extension file into uri. we can't just use random string without extension file into it.

thanks for your guide.. :)