noam aghai
noam aghai

Reputation: 1446

Receive share file intents with Flutter

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?

Upvotes: 16

Views: 12762

Answers (3)

ritsapp
ritsapp

Reputation: 108

It is already answered but wanted to share more details on this,

Here, you can use receive_sharing_intent package. It is null safe & it supports the android & iOS platforms. Using this package you can receive text & multiple media files in open as well as closed applications. So it makes life easier.

For further understanding of how to receive text & multiple media files, you can go through this link. Also there you will get to know how to receive intent in the closed application.

Upvotes: 2

dsilveira
dsilveira

Reputation: 386

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

Upvotes: 6

Ronen Rabinovici
Ronen Rabinovici

Reputation: 9138

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

Upvotes: 2

Related Questions