NativeScript / NativeScript/docs

Document how to access a local service through "localhost"

未關閉
#5 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement
主要語言
JavaScript
星號
17
分支
31
平均合併
8 小時 51 分鐘
30 天內合併 PR
2

描述

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?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先找到介紹本機服務或網路通訊的 NativeScript 文件頁面。驗證 localhost 的行為以及 iOS 和 Android 常見的模擬器/裝置位址,然後記錄 cleartext-traffic 的要求,包括缺少的 iOS 指南。完成的標準是該頁面涵蓋列表中的每個環境,並提供準確的位址和設定說明。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, ios
領域
documentation, mobile-dev
Issue 類型
文件
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。