RobinBobin / react-native-google-drive-api-wrapper

This wrapper facilitates the use of the Google Drive API in React Native projects.
110 stars 43 forks source link

Upload file does not work #4

Closed r2moon closed 6 years ago

r2moon commented 6 years ago

I got 403 error while createFileMultipart. The google sign in is working, but drive api does not work.

Here is screenshot

Here is Google Signin Scrips and Drive Api call script.

await GoogleSignIn.configure({ scopes: ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.metadata', ], shouldFetchBasicProfile: true, offlineAccess: true });

let res = await GDrive.files.createFileMultipart("My File Contents", "text/plain", { parents: ['root'], name: "myfile" })

r2moon commented 6 years ago

Oh, I found the reason. It's because I didn't enable google drive api.