突然にXcodeのアップデート後に動作していないネイティブのネットワークを反応させ、私は8.3.2に私のXcodeを更新した後、すべての私のアプリケーションはNewtwork要求が失敗ばかりしている、は私がの値を変更しようとした8.3.2
Network request failed
TypeError: Network request failed
/ios/[projectname]/info.plistでも、https://エンドポイントを呼び出していても、同じエラーが表示されます。再現する
<key>NSAppTransportSecurity</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
手順: - $反応し、ネイティブのinit newProject & & CD newProject & &反応し、ネイティブの実行IOS
オープンindex.ios.jsおよび追加テスト
<Button title="fetch" onPress={async()=>{
const r = await fetch('http://localhost/ivf/system/settings');
console.log(r);
}}/>
<Button title="fetchs" onPress={async()=>{
const r = await fetch('https://ivf.simpleinfroamtics.com/system/settings').catch(console.log);
console.log(r);
}}/>
両方のリンクをクリックすると、両方ともnewtwok要求が失敗して失敗します。私はXHRを使ってみました
は
componentDidMount(){
<Button title="console" onPress={()=>{
console.log('log');
console.debug('debug');
console.info('info');
console.warn('warn');
}}/>
<Button title="fetch" onPress={async()=>{
const r = await fetch('http://localhost/ivf/system/settings');
console.log(r);
}}/>
<Button title="fetchs" onPress={async()=>{
const r = await fetch('https://ivf.simpleinfroamtics.com/system/settings').catch(console.log);
console.log(r);
}}/>
}
まだ正確に同じエラーをinsteed。
どうすればこの問題を解決できますか?私はすでに私の全体のアプリを終了し、私はので、私は公開することができます:(あなたの例外は唯一の非ローカルホストのURLへの非セキュアな接続を可能にし
おかげ