Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 606
noam aghai Avatar asked May 22 '18 20:05

noam aghai


People also ask

How do I handle incoming intents from external applications in flutter?

The answer to this question could be the uni_links package. You simply set up a listener to the incoming App/Deep links and call whatever methods you need :) I do this like that: _linkStream = getUriLinksStream().

How do you call an intent in flutter?

Intent myapp = new Intent("android. intent. action. GET_PIN_CODE"); myapp.


1 Answers

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

like image 196
dsilveira Avatar answered Sep 17 '22 16:09

dsilveira