【问题标题】:How to send image from android gallery to react-native app?如何将图像从 android 图库发送到 react-native 应用程序?
【发布时间】:2017-01-16 14:22:42
【问题描述】:

如何将图像从 android 图库分享到 react-native 应用程序?

我在我的 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 应用。

【问题讨论】:

  • 你读过CameraRoll
  • 谢谢,但我不认为 CameraRoll 可以帮助我。它应该更像Linking 但没有 url

标签: react-native react-native-android


【解决方案1】:

目前没有内置方法来处理这个问题。所以我自己写了一个简单的原生android模块。

终于找到了一个支持ios和android的扩展。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多