I have an iOS native app.
I have an API developed in Rails (4.1.4), which lives at : http://api.myapp.local:5000.
I have configured my /etc/hosts to do my basic API / web development, no problem everything work perfectly.
My problem is that I want to consume my local API through my iOS app (in an actual device, not in simulator) over WiFi.
Here's what I've tested (that does not work)
- Using xip.io with my local en0 inet ip with thin webserver.
- Using xip.io with my local en0 inet ip with pow webserver.
- I've done some port forwarding to connect via my public IP
The problem is essentially due to the subdomain, indeed: all above solutions work if my app doesn't have any subdomain. (I can reach my local API this way, but this is not what I want)
My issue is that I can't tell my iOS app, "connect to this IP, using this subdomain"
I probably have a lack of knowledge in term of network, but I'm really annoyed by this problem, since I really need to test my local webserver with my iOS app.
Here is what my routes file looks like:
constraints subdomain: 'api', format: 'json' do
scope module: :api do
scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
resources :packs, only: [:index, :show]
end
end
end