How to prevent load of meteor.local (when building ios app with phonegap)

本秂侑毒 提交于 2019-12-20 12:31:29

问题


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

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:

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

The ones I added were:

Meteor.absoluteUrl.defaultOptions.rootUrl
process.env.ROOT_URL
process.env.MOBILE_ROOT_URL 
process.env.MOBILE_DDP_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.


回答1:


Have a look at this post :

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


来源:https://stackoverflow.com/questions/28948742/how-to-prevent-load-of-meteor-local-when-building-ios-app-with-phonegap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!