Receive share file intents with Flutter

9,929

Solution 1

You can use flutter-share, all info in Github

You won't have to meddle with java except for changing the MainActivity extends.

It is fully functional for Android, and the iOS part is currently being developed to match the Android part.

Update (2020):

Now you can also use receive_sharing_intent package. More info in pub.dev

Solution 2

There's a complete & simple example here - it includes everything you need both on the native side, and on the flutter side: https://flutter.io/flutter-for-android/#how-do-i-handle-incoming-intents-from-external-applications-in-flutter

Share:
9,929
noam aghai
Author by

noam aghai

Updated on December 05, 2022

Comments

  • noam aghai
    noam aghai over 1 year

    I searched for a way to make my flutter app receive intents from other apps, but didn't find any.

    I want to RECEIVE INTENTS not to send them.

    example:

    I want to open the Gallery and click on the share button, and choose my flutter app from the menu. and then have my flutter app receive the intent with the picture (and later send it by HTTP request).

    Does anyone know how to do it?

  • noam aghai
    noam aghai almost 6 years
    This plugin not working well on android, This has an android exceptions, Please fix it.
  • dsilveira
    dsilveira almost 6 years
    Hi @noamaghai, thank you very much for your feedback, can I please ask you to file an issue on the github page with the details of your crash, like stack trace, and how did you setup the plugin, and what did you do just before the crash, please, so that I can help you! thanks again.
  • noam aghai
    noam aghai almost 6 years
    Hi @dsilveira, already did that .... Please watch out about updates on your Github
  • dsilveira
    dsilveira almost 6 years
    I didn't get any email notification :O I've read it, and replied, lets continue debugging over there. Thanks
  • Salx
    Salx over 5 years
    @dsilveira Any ETA on the ios support? I'm looking for this for my project.
  • dsilveira
    dsilveira over 5 years
    hey @Salx I'm loking for help on that front, since I haven't had the time lately to work on this plugin, can you, or do you know someone willing to step up and help with it? Otherwise, It'll just have to wait for my spare time to become reasonsble again
  • E.Bradford
    E.Bradford over 4 years
    Doesn't handle IOS shares.
  • ThorstenC
    ThorstenC over 3 years
    Does this work on iOS 14? My attempts never produce a share target on a real device.