如何防止负载meteor.local(当使用phonegap构建ios应用程序时) [英] How to prevent load of meteor.local (when building ios app with phonegap)

查看:115
本文介绍了如何防止负载meteor.local(当使用phonegap构建ios应用程序时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我问过的问题的扩展这里,没有得到答复。我试图使用我的iPad上的Meteor应用程序,我在我自己的远程服务器上托管。问题是,当我运行以下命令,应用程序构建成功:

This is an extension of a question I asked here, which went unanswered. I am attempting to use the Meteor app on my iPad that I'm hosting on my own remote server. The issue is that when I run the following command, the app builds successfully:

sudo meteor run ios-device --mobile-server=XXXX:XXXX

问题从我在Xcode中单击构建按钮以部署应用程序我的设备。它似乎建立一切OK,甚至从我的远程服务器加载数据。但几秒钟后,它恢复到本地数据库/构建。当我检查Xcode日志,它说完成加载的 http://meteor.local/ ,所以它似乎用新的本地数据覆盖远程数据。我不知道如果我有一些启用的东西导致Xcode加载本地数据库,或者如果有一些我必须关闭,以防止它加载。

The problem begins when I click the build button in Xcode to deploy the app to my device. It seems to build everything OK and even load the data from my remote server. But after a few seconds, it reverts back to a local database/build. When I check the Xcode log, it says "Finished load of http://meteor.local/" so it seems to be overwriting the remote data with new, local data. I'm not sure if I have something enabled that's causing Xcode to load a local database or if there's something that I have to turn off to prevent it from loading.

UPDATE :

我已经使用Jey DWork的建议解决了问题,以便在Meteor服务器启动时应用缺少的环境变量。

I've resolved the issue using the suggestion from Jey DWork to apply the missing environment variables in the Meteor server startup.

我添加的是:

Meteor.absoluteUrl.defaultOptions.rootUrl
process.env.ROOT_URL
process.env.MOBILE_ROOT_URL 
process.env.MOBILE_DDP_URL

这些,ROOT_URL似乎在初始加载后被覆盖。由于这些环境变量似乎没有记录,我仍然要搜索,看看是否有一个不同的解决方案这个问题(因为它似乎奇怪,应用程序将不得不重新加载自身多次,在它可用之前) 。

Without setting these, the ROOT_URL seemed to be getting overwritten after the initial load. As these environment variables do not seem to be documented, I'm still going to search and see if there is a different solution to this issue (as it seems strange that the app would have to re-load itself multiple times before it's usable). For now though, this is a temporary solution.

推荐答案

看看这篇文章:


我已经理解我的问题,也许你的问题是一样的,所有的解释:stackoverflow.com/questions/34658956 /

I've understood my problem, maybe your problem is the same, all explanations here : stackoverflow.com/questions/34658956/

  • Your app for smartphone must be built with --server=http://IP:PORT parameters
  • And
  • Your app for server must be started with --mobile-server http://IP:PORT parameters
  • 这篇关于如何防止负载meteor.local(当使用phonegap构建ios应用程序时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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