react native下fetch ios9报network request failed的问题
发布时间:2020-12-15 03:26:36 所属栏目:百科 来源:网络整理
导读:环境: RN: 0.28 iOS: 9 xcode: 7.0.1 现象: 执行以下语句时: fetch('http://facebook.github.io/react-native/movies.json') .then((response) = response.json()) .then((responseJson) = { return responseJson.movies; }) .catch((error) = { console.
环境: RN: 0.28 iOS: 9 xcode: 7.0.1
现象: 执行以下语句时: fetch('http://facebook.github.io/react-native/movies.json') .then((response) => response.json()) .then((responseJson) => { return responseJson.movies; }) .catch((error) => { console.error(error); }); 总是报错:
查了一堆资料,最后解决:
http需要配置info.plist,具体配置如下: 参考: http://www.codes51.com/article/detail_2177325.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |