document-picker icon indicating copy to clipboard operation
document-picker copied to clipboard

How do I configure Google Drive Access?

Open sentry0 opened this issue 8 years ago • 3 comments

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.

sentry0 avatar Mar 06 '18 01:03 sentry0

the same issue, ...

matsatit avatar Mar 18 '18 09:03 matsatit

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
    }
});

sentry0 avatar Mar 18 '18 14:03 sentry0

In filetype use public.text in IOS or android .xml, text/xml

apipemc avatar Sep 03 '18 14:09 apipemc