joutvhu / open_file_plus

A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)
https://pub.dev/packages/open_file_plus
BSD 3-Clause "New" or "Revised" License
5 stars 11 forks source link

Nothing happens when OpenFile method is called #6

Closed levi956 closed 1 year ago

levi956 commented 1 year ago

I called the method

OpenFile.open(file.path, type: 'pdf');

on an Android Emulator and nothing shows up or happens, but it seems like it's executing. Do I need to set any permission in the Android Manifest file or the emulator doesn't have a means to open the file hence nothing?

joutvhu commented 1 year ago

You should use the mime type of the file. Ex: OpenFile.open(file.path, type: 'application/pdf'); Or don't provide the type, the lib will automatically get the mime type based on the file's suffix.

levi956 commented 1 year ago

Worked, thanks.