3
votes

I've been attempting to get a Meteor/Cordova/Phonegap iOS app up and running. I'm following the documentation provided here: https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration

To keep things simple I'm just testing the example leaderboard meteor project. When I follow the steps mentioned in the link above, I can run the app no problem in the iOS simulator and directly on the device via xcode using either of the following commands:

meteor run ios

or

meteor run ios-device --mobile-port 10.0.1.2:3000 -p 10.0.1.2:3000

To test a production environment, I've deployed the app directly to meteor.com

meteor deploy [my-app-name]

Following the instructions on building, I'm specifying the host and port of my remote server in the build command:

meteor build ../buildfolder -p [my-app-name].meteor.com:80

When I try running the app via the generated xcode project (in the simulator), I see nothing but a blank white screen when the app launches. There are no errors in xcode's logger, but here's what the output looks like:

16:01:41.583 [CDVTimer][file] 6.641030ms
16:01:41.607 [CDVTimer][statusbar] 23.925006ms
16:01:41.607 [CDVTimer][TotalPluginStartup] 30.839026ms
16:01:41.709 Resetting plugins due to page load.
16:01:41.739 Finished load of: (snip)
16:01:41.791 Starting the server on port 40539
16:01:41.792 Setting document root: <snip>
16:01:41.792 Started httpd on port 40539
16:01:41:792 staffutility[49019:607] HTTPServer: Started HTTP server on port 40539
16:01:41.792 addresses: {
    "en1/ipv4" = "10.0.1.12";
    "en1/ipv6" = "fe80::7ec3:a1ff:fea4:49c5";
    "lo0/ipv4" = "127.0.0.1";
    "lo0/ipv6" = "fe80::1";
    "vboxnet0/ipv4" = "192.168.56.1";
}
16:01:41.794 Resetting plugins due to page load.

Note: I've also tested deploying the meteor project using Meteor Up: https://github.com/arunoda/meteor-up on my own EC2 instance, with the exact same results. The iOS app just sits there with a blank white screen. (Hitting the url via browser works fine)

Any idea what the issue might be?

3

3 Answers

2
votes

Not enough reputation to comment, hence posting an answer.

Had the same issue, but the only way I could get it to work is by manually changing the host:port in Xcode. After building, open the project in xcode, go to staging > www > index.html.

In the following block, removing the port number made the app to work again.

__meteor_runtime_config__ = {"meteorRelease":"[email protected]",
"ROOT_URL":"http://[my-app-name].meteor.com",
"ROOT_URL_PATH_PREFIX":"",
"DDP_DEFAULT_CONNECTION_URL":"http://[my-app-name].meteor.com",
"autoupdateVersionCordova":"426a072de258af04658e2585485c277b8aac18a3"};

I don't fully understand why, but I tried checking the port number of my app by console.logging it after deploying to meteor.com. It seems like the port number is random after deploying. I look forward to someone throwing more light on deploying without having to include a port number.

2
votes

go to your home directory (NOT your app directory)

$HOME/ rm -rf.meteor

Rerun the application

0
votes

Looks like after updating to meteor 0.9.4 (which apparently includes improved Cordova/Phonegap support) my issue has been resolved.