【发布时间】:2018-10-06 10:09:40
【问题描述】:
React Native [Android]
三星手机
图书馆:
- react-native-document-picker [返回我们的 URI]
- react-native-get-real-path [将 URI 转换为真实路径]
能够:
- 从本地文件获取 URI 并获取包含图片的真实路径
- 当我选择文件时能够从 Google Drive 获取 URI
无法:
-
将 Google Drive URI 转换为真实路径
DocumentPicker.show({filetype: [DocumentPickerUtil.allFiles()],},(error,res) => { RNGRP.getRealPathFromURI(path).then(function(androidPath){ console.log('AndroidPath : ', androidPath); }) }
我来自谷歌驱动器的 URI 是这样的:
content://com.google.android.apps.docs.storage/document/acc%3D2%3Bdoc%3D1
【问题讨论】:
-
你有什么运气吗?
-
很遗憾我没有。仍在等待任何建议。适用于 IOS,但不适用于 Android。
标签: react-native uri react-native-android