Receive share file intents with Flutter

自作多情 提交于 2020-01-24 03:46:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!