New to react-native. Trying to do simple crud operations on a google spreadsheet located in google drive. I've successfully implemented the packages for react-native-google-signin and react-native-google-drive-api-wrapper and can see my spreadsheets. Next step is finding a react-native package that implements google sheets API v4. I've tried Iwark's/react-native-spreadsheet for react/node.js but it produces errors when trying to build in a react-native environment. Any direction would be appreciated.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I am hoping can do this using googleapis and google-auth-library
two libraries;
Then initialise the apis by doing
var authClient = new googleAuth();
var auth = new authClient.OAuth2();
auth.credentials = {
access_token: accessToken
};
this.service = google.sheets({version: 'v4', auth: auth});
Then use the this.service
If this doesn't make much sense, wait for few hours or tomorrow, I will help you with a working copy. :)
EDIT: This is what I think you should do,"
- If you have your spreadsheet public, follow this
- If your spreadsheet is private
a) You need to make the user login (use firebase google login), then get the access_token and do a get with access_token in https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}
or post request etc.
b) Make a post request in your node server where you handle all of these
Note: I might help you with a working example this weekend.