流星可以与PhoneGap一起使用吗? [英] Can Meteor be used with PhoneGap?

查看:121
本文介绍了流星可以与PhoneGap一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Meteor模板可以打包并部署为PhoneGap应用程序吗?

Can a Meteor template be packaged up and deployed as a PhoneGap application?

推荐答案

是的,这是可能的,但不是通过在手机上打包流星应用程序。您必须将phonegap指向您的流星服务器(您仍然可以使用API​​访问设备上的功能)。以下是说明:

Yes, this is possible, but not by packaging the meteor app on the phone. You have to point phonegap to your meteor server instead (you will still be able to use the API for accessing functionality on the device). Here are the instructions:

  • Grab the latest copy of phonegap 2.2.* from https://github.com/phonegap/phonegap (2.1 has a bug that prevents this technique from working)
  • Create your phonegap project and whitelist your meteor server domain name using the instructions here: http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html
  • For iOS, find and open CordovaLib/Classes/CDVViewController.m and around line 175, overwrite appURL with appURL = [NSURL URLWithString:@"http://your-server.com"];

就是这样。编译并运行应用程序。

That's it. Compile and run the app.

一对夫妇的时间:


  • 可以通过将www /目录内容复制到Meteor服务器根目录中来开始设置meteor目录。请务必复制client /目录下的javascript文件,以便在主流meteor js文件之前加载它们。

  • 从主Meteor js文件运行app.initialize(window),if

  • 不要尝试在Xcode中的www /目录下设置meteor服务器。您将无法部署到设备,因为.meteor子目录包含指向您的节点模块的符号链接。

这篇关于流星可以与PhoneGap一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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