Add localhost
as an exception to your app/App_Resources/iOS/Info.plist
file to allow insecure (non-HTTPS) communication with the http://localhost
domain:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
This is preferable to allowing insecure communication with all domains.
EDIT: Also, remember that you must rebuild your app after editing that Info.plist
file! Its changes cannot simply be live-synced or hot module reloaded like JS.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…