如何使用googleapis进行本机反应? [英] How can I use googleapis into react native?

查看:75
本文介绍了如何使用googleapis进行本机反应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在尝试使用Google Drive API v3来响应本机.我以谷歌驱动器API v3为例[a href ="https://developers.google.com/drive/v3/web/quickstart/nodejs" rel ="nofollow noreferrer"> Node.js .但是问题是当我尝试将googleapis导入到我的项目中时,它显示在下面的错误中.

Currently, I am trying to use google drive API v3 into react native. I am taking as an example from google drive API v3 Node.js. But the problem is when I am trying to import the googleapis into my project it's showing below error.

我搜索了很多次,但是找不到解决方案.有人可以帮我吗?

I googled many times but can't find solutions. Can anybody help me out of this?

推荐答案

用于Google云端硬盘的Node.JS API使用Node的内置path模块.除了开发人员工具之外, React Native并非建立在Node之上-它利用了Safari的JavaScript引擎JavaScriptCore.因此,当您运行应用程序时,path模块不存在,并且API客户端将无法工作.

The Node.JS API for Google Drive makes use of Node's built-in path module. Aside from the developer tools, React Native is not built on top of Node - it makes use of Safari's JavaScript engine, JavaScriptCore. Therefore, when you run your application, the path module doesn't exist, and the API client won't work.

您需要直接使用 REST API 与Google进行通信

You instead need to make use of the REST API directly to communicate with Google.

这篇关于如何使用googleapis进行本机反应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆