React-Native-Abruf, Netzwerkanforderung fehlgeschlagen. ohne localhost

Ich habe eine App, die ich benutze, um Benutzer zu authentifizieren. Es hat bis vor ein paar Tagen funktioniert und ich habe nichts geändert. Nur ein Upgrade von React 0.27 auf 0.28, Not Fetch funktioniert nicht.

ch habe fast 2 Tage gesucht und fast alle Fragen in stackoverflow gelesen. Die meisten Benutzer versuchen, etwas von localhost abzurufen. Wenn sie es in die tatsächliche IP-Adresse ändern, funktioniert es. aber ich hole nichts von localhost, auch mein Code funktionierte früher.

hier ist mein Code:

fetch('http://somesite.com/app/connect', {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'language':'en-US',
        'Authorization': 'Bearer ' + access_token,
      },
      body: JSON.stringify({
        uid: uid,
        refresh_token: refresh_token,
        token: access_token,
        device: device_id,
        device_name: device_name,
      })
    })
.then((response) => response.json())
.then((responseData) => {
    console.log(JSON.stringify(responseData.body))
})
.catch((err)=> {
  console.log('Some errors occured');
  console.log(err);
})
.done();

Ich habe versucht, einige neue Projekte einfach zu machen, habe nur ein einfaches Abrufbeispiel für Tutorials verwendet, es gab den gleichen Fehler. Ich habe versucht, meine Website zu öffnen, die ich versuche, eine Verbindung mit ihr herzustellen. Über den Browser im Emulator funktioniert das, aber es scheint, dass über meine App keine Verbindung mit einer Website / IP hergestellt werden kann. Es gibt diesen Fehler in der Chrome-Konsole:

TypeError: Network request failed
    at XMLHttpRequest.xhr.onerror (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:28193:8)
    at XMLHttpRequest.dispatchEvent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:14591:15)
    at XMLHttpRequest.setReadyState (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:29573:6)
    at XMLHttpRequest.__didCompleteResponse (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:29431:6)
    at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:29506:52
    at RCTDeviceEventEmitter.emit (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:13428:23)
    at MessageQueue.__callFunction (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:11999:23)
    at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:11906:8
    at guard (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:11857:1)
    at MessageQueue.callFunctionReturnFlushedQueue (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true:11905:1)

Eigentlich habe ich das gleiche Problem wie dieser Benutzer hier: React-native Netzwerkanforderung schlägt immer fehl

UPDATE: info.plist von xcode

Jede Hilfe wird geschätzt!

Antworten auf die Frage(6)

Ihre Antwort auf die Frage