简体   繁体   English

我如何使用googleapis进行原生反应?

[英]How can I use googleapis into react native?

Currently, I am trying to use google drive API v3 into react native. 目前,我正在尝试使用google drive API v3进行本机反应。 I am taking as an example from google drive API v3 Node.js . 我以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. 但问题是,当我尝试将googleapis导入我的项目时,它显示在下方错误。

在此输入图像描述

I googled many times but can't find solutions. 我google了很多次但找不到解决方案。 Can anybody help me out of this? 任何人都可以帮我解决这个问题吗?

The Node.JS API for Google Drive makes use of Node's built-in path module. Google Drive的Node.JS API使用Node的内置path模块。 Aside from the developer tools, React Native is not built on top of Node - it makes use of Safari's JavaScript engine, JavaScriptCore. 除了开发人员工具, React Native不是建立在Node之上 - 它使用了Safari的JavaScript引擎JavaScriptCore。 Therefore, when you run your application, the path module doesn't exist, and the API client won't work. 因此,在运行应用程序时, path模块不存在,并且API客户端将无法运行。

You instead need to make use of the REST API directly to communicate with Google. 您需要直接使用REST API与Google进行通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM