带有React Native的Google Sheets API [英] Google Sheets API with React Native
问题描述
本机反应新手.尝试对位于Google Drive中的Google电子表格执行简单的操作.我已经成功实现了 react-native-google-signin 和 react-native-google-drive-api-包装器,并可以查看我的电子表格.下一步是找到实现Google表格API v4的react-native程序包.我已经尝试过 Iwark的/react-native-spreadsheet 用于react/node.js,但是尝试在本机环境中构建时会产生错误.任何方向将不胜感激.
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.
推荐答案
我希望可以使用googleapis and google-auth-library
两个库来做到这一点;
然后通过初始化apis
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});
然后使用this.service
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. :)
我认为这是您应该做的,"
This is what I think you should do,"