Im making a react-native app and in one functionality I want to let the users pick any file from their device or google drive. I'm using the expo-document-picker for this. Im trying to enable my picker to choose from google spreadsheets, presentation, and docs. I read the documentation and you can specify the MIME types while calling the function, but nothing has worked while passing the MIME options I want.
I know google has their MIME types published in here https://developers.google.com/drive/api/v3/mime-types, but I don't know if I have to do any previous setup for this to work.
None of the following options have worked:
await DocumentPicker.getDocumentAsync();
Not passing any parameters to the function defaults to allowing all types, but for some reason excludes google drive ones. The result of this code looks like this
Now if I explicitely specify in the options to listen to the google mime types (which I got from the link from above), it still doesn't work.
await DocumentPicker.getDocumentAsync({type: 'application/vnd.google-apps.document'});
I don't know if I have to install any libraries for the picker to identify this types, or if it is just straight up not possible to handle with the expo-document-picker. Thanks for your time!
question from:
https://stackoverflow.com/questions/65911130/how-to-enable-google-drive-files-to-the-expo-document-picker 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…