Search code examples
flutterfilelauncher

How to open external files using flutter app?


How can I open other apps or files using my flutter app? Let's say, if I am going to open some photos, it asks me if I want to open them with the Gallery or other app like image viewer. Like this, I want to add an option that if I press on some file, like pdf, I want my app to be in the list of launcher apps so when it asks me to choose a launcher app, my app will be there as well. Here is a demo image: enter image description here

In android, it is working very well. But, in IOS, when I launch the app with external file, catching url of that file is getting a real problem. Receive sharing intent package did not work for me, I have gone through docs for many times.

I used native code for android to parse uri of file to absolute path, but could not find anything efficient for iOS. Could someone please, help to solve this problem?


Solution

  • What you're looking for is the receive_sharing_intent or receive_multi_sharing_intent.

    They're Flutter plugins that enable Flutter apps to receive sharing photos, videos text, URL, or any other type from other apps.