document-picker
document-picker copied to clipboard
How do I configure Google Drive Access?
I seem to have the ability to see and browse Drive but I can't open any documents from it. Opening documents locally works.
The only way I can access drive is by allowing access to all files...I need to only allow access to XML files or my program barfs.
the same issue, ...
While not a solution per si I worked around the issue by allowing the app to load any file and then check the mime type after.
DocumentPicker.show({filetype: [DocumentPickerUtil.allFiles()]},(error, result) => {
if (result === null) {
return;
}
if ((Platform.OS === 'ios' && result.fileName.endsWith('.XML')) ||
(result.type === 'text/xml' || result.type === 'application/xml')) {
// Read the file in...it's good
} else {
// show the user a message about an invalid file type
}
});
In filetype use public.text in IOS or android .xml, text/xml