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);
})
}
我的Google Drive链接是这样的:
content://com.google.android.apps.docs.storage/document/acc%3D2%3Bdoc%3D1