How to send image from android gallery to react-native app?

牧云@^-^@ 提交于 2019-12-12 04:33:57

问题


How do i share an image from android gallery to react-native app?

I've added an intent-filter to my AndroidManifest.xml:

<intent-filter>
  <action android:name="android.intent.action.SEND" />
  <category android:name="android.intent.category.DEFAULT" />
  <data android:mimeType="image/*" />
</intent-filter>

How do i listen to the send intent?

Edit: I want to send an image from native image gallery to my react-native app, like sharing an image from gallery to instagram app.


回答1:


There is currently no builtin method to handle this. So i wrote a simple native android module by my own.

Finally i found an extension which supports ios and android.

https://github.com/alinz/react-native-share-extension



来源:https://stackoverflow.com/questions/41623393/how-to-send-image-from-android-gallery-to-react-native-app

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