'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?



Solution 1:[1]

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

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ronen Rabinovici
Solution 2 Ankur Lahiry