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

HELP:how to show images from google drive #29

Closed mohamed-ikram closed 3 years ago

mohamed-ikram commented 4 years ago

GDrive.setAccessToken(this.state.authToken); GDrive.init(); GDrive.isInitialized() ? console.log(true) : console.log(false);

let list = await GDrive.files.list({ q:"type:image", }); console.log(list);

when i pass images in query params response is like this {"_bodyBlob": {"_data": {"collector": [Object], "blobId": "d847725e-e774-47c1-8c8f-ee7f0a982b4b", "offset": 0, "size": 249}}, "_bodyInit": {"_data": {"collector": [Object], "blobId": "d847725e-e774-47c1-8c8f-ee7f0a982b4b", "offset": 0, "size": 249}}, "bodyUsed": false, "headers": {"map": {"alt-svc": "h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"", "cache-control": "private, max-age=0", "content-security-policy": "frame-ancestors 'self'", "content-type": "application/json; charset=UTF-8", "date": "Tue, 30 Jun 2020 12:28:48 GMT", "expires": "Tue, 30 Jun 2020 12:28:48 GMT", "server": "GSE", "vary": "Origin, X-Origin", "www-authenticate": "Bearer realm="https://accounts.google.com/\", error=invalid_token", "x-content-type-options": "nosniff", "x-frame-options": "SAMEORIGIN", "x-xss-protection": "1; mode=block"}}, "ok": false, "status": 401, "statusText": undefined, "type": "default", "url": "https://www.googleapis.com/drive/v3/files?q=type:image"}