如何将图像从 android 库发送到本机应用程序?
问题描述:
如何将 android 库中的图像分享到 react-native 应用程序?
How do i share an image from android gallery to react-native app?
我在 AndroidManifest.xml 中添加了一个意图过滤器:
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>
如何监听发送意图?
我想将图片从本机图片库发送到我的 react-native 应用,例如将图片从图库分享到 Instagram 应用.
I want to send an image from native image gallery to my react-native app, like sharing an image from gallery to instagram app.
答
目前没有内置方法来处理这个问题.所以我自己写了一个简单的原生 android 模块.
There is currently no builtin method to handle this. So i wrote a simple native android module by my own.
终于找到了一个支持ios和android的扩展.
Finally i found an extension which supports ios and android.