Javascript 带有 node.js 的 Phonegap

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14513029/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 17:03:06  来源:igfitidea点击:

Phonegap with node.js

javascriptiosnode.jscordova

提问by devnill

I'm developing an IOS app using phone gap and I'd like to use node.js for part of it. Is it feasable to get phonegap to run an instance of node.js along side the rest of the app?

我正在使用电话间隙开发 IOS 应用程序,我想使用 node.js 作为其中的一部分。让 phonegap 与应用程序的其余部分一起运行 node.js 实例是否可行?

回答by Jason Sebring

Phonegap is a client-side solution only with JavaScript/CSS/HTML running on the browser-app of the phone. The JavaScript Phonegap API talks to the native phone interface and browser interface which gives you options to work natively and as a normal web page would with enhanced permissions. Node.js would only serve you as a data connection for JSON or whatever else you would need to pull/push with a network call.

Phonegap 是一种客户端解决方案,仅在手机的浏览器应用程序上运行 JavaScript/CSS/HTML。JavaScript Phonegap API 与本机电话界面和浏览器界面对话,这为您提供了本机工作选项以及具有增强权限的普通网页。Node.js 只会为您提供 JSON 的数据连接,或者您需要通过网络调用拉/推的任何其他内容。



UPDATE: @Turion had a great comment and made me look a little deeper. Here's what the stack and google came up with:

更新:@Turion 有一个很好的评论,让我看起来更深入一点。这是堆栈和谷歌提出的:

Native IOS app and node.js

原生 IOS 应用程序和 node.js

and direct YouTube link to neu.Node (Node runnning on iphone!!!) http://www.youtube.com/watch?v=xzFH80-HYTo

和指向 neu.Node 的直接 YouTube 链接(在 iPhone 上运行的节点!!!)http://www.youtube.com/watch?v=xzFH80-HYTo

回答by Rodrigo Calix

This might be helpful:

这可能会有所帮助:

http://phonegap.com/blog/build/phonegap-build-api-for-node/

http://phonegap.com/blog/build/phonegap-build-api-for-node/

phonegap-build-api-js is a published NPM module for accessing the PhoneGap Build API with node.js. It abstracts the HTTP communication, deals with the API quirks, and leaves the rest untouched. In other words, it simplifies accessing the PhoneGap Build API, so that you can focus on integrating it with your product.

phonegap-build-api-js 是一个已发布的 NPM 模块,用于使用 node.js 访问 PhoneGap Build API。它抽象了 HTTP 通信,处理 API 怪癖,并保持其余部分不变。换句话说,它简化了对 PhoneGap Build API 的访问,因此您可以专注于将它与您的产品集成。