NativeScript / docs

The NativeScript Docs!

Home Page:https://docs.nativescript.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document how to access a local service through "localhost"

rigor789 opened this issue · comments

Accessing localhost depends on where the apps is running:

  • iOS Simulator -> can access localhost/127.0.0.1
  • Android emulator -> needs to use a special IP, often 10.2.2.0 (todo: fact-check and list common ips to try)
  • iOS Device -> needs to access an address accessible on the local network like 192.168.0.x or similar
  • Androud device -> same as iOS device.

Mention that cleartext traffic is blocked by default (silently), so http or ws requests will not work unless you specifically allow cleartext traffic:

Android:

<application
 <!-- ... -->
 android:usesCleartextTraffic="true"
 <!-- ... -->
</application>

ios?