问题
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?
回答1:
try this: https://github.com/d-silveira/flutter-share.git
you won't have to meddle with java except for changing the MainActivity extends.
It is fully functional for Android, the IOS part is currently being developed to match the Android part.
回答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
来源:https://stackoverflow.com/questions/50476159/receive-share-file-intents-with-flutter