flyerhq/react-native-android-uri-path

Can't get path for directory

gj94gj94ao4 opened this issue · 2 comments

Work fine with react-native-document-picker to pick files and get their path.
but can't get path for a directory.

const path = await pickDirectory()
if (path !== null) {
  const realPath = getPath(path.uri);
  // Error: Exception in HostFunction: java.lang.UnsupportedOperationException: Unsupported Uri 
  // content://com.android.externalstorage.documents/tree/primary%3A...
  console.log(realPath);
}

See #18 I think maybe this library is not needed at all now. I am not an Android developer, and only found this solution to pick files somewhere, not sure I will be able to adapt to directories as well.

rnmods/react-native-document-picker#70 (comment) also mentioned in the README of the document picker repo as well, is the correct way to retrieve the path. This repo will be archived.