iOS application is unsuable on device


#1

We are using Meteor 1.1.0.2 to develop hybrid application. The application works on web without any JS error but when we convert to iOS using XCode 6 then application is unsuable. We are unable to login to application which is based on out of accounts-password package

On debugging we are getting the following message on console
http://localhost:3000/sockjs/info?cb=i9iykxy2fvFailed3 to load resource: Could not connect to the server

We tried using IP instead of local host but no change in results. Any guidance to resolve the problem will be highly appreciated

Regards,
Naveen Jindal


#2

Unless you’re running in the simulator, an iOS app won’t be able to connect to localhost. Are you using meteor run ios-device to open the Xcode project? That should set the right URL automatically in most cases.

If not, you can override this with the --mobile-server option. If you’re using meteor build, there is no autodetection and you will always have to specify --server.

Where are you running your server app? If you’re not using meteor deploy, you will also have to set the ROOT_URL there.


#3

Thanks for your reply. We tried both by providing IP and without IP with command “meteor run ios-device --mobile-server :” but results are negative while trying to connect to device from xcode

It is same result that we have when we deploy on NodeJS after setting ROOT_URL

Regards,
Naveen Jindal


#4

I don’t think this should make a difference, but could you try with Meteor 1.2 RC (meteor update --release 1.2-rc.15)?


#5

Hi, I upgraded the meteor version to 1.2 rc.15, but still getting the same error. Any further suggestions or recommendation?


#6

We have found that it works on the iOS simulator, but we are getting the same error when we connect to the physical device (iPhone 6) in debug mode: http://localhost:3000/sockjs/info?cb=i9iykxy2fvFailed31 to load resource: Could not connect to the server.


#7

Just to clarify, are you sure both of these conditions are satisfied?

  1. You either use meteor run with the --mobile-server option or meteor build with the --server option and have specified the URL of your server.
  2. Your server has the ROOT_URL env variable set to that same URL.