1
我使用的构建应用程序的反应本土,但它不是只读取在iOS中使用爱可信的数据,安卓其做工精细阵营本机应用程序的NetInfo返回未知
当我使用的NetInfo它返回未知检查网络的状态
componentWillMount() {
this.getLocation().done();
var cusineServiceParams = {
'limit': '6',
'offset': '0',
};
axios.post('http://www.some.preview.domain.com/api/gc', cusineServiceParams)
.then(function (response) {
this.setState({
cusineList: response.data
})
}.bind(this))
.catch(function (error) {
alert('connection error');
});
}
我总是收到连接错误
这里是我的info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SOMEAPP</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.somea</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>SomeApp</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UIAppFonts</key>
<array>
<string>Andale Mono.ttf</string>
<string>Arial Black.ttf</string>
<string>Arial.ttf</string>
<string>Comic Sans MS.ttf</string>
<string>Courier New.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Georgia.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Microsoft Sans Serif.ttf</string>
<string>Octicons.ttf</string>
<string>Roboto.ttf</string>
<string>Roboto_medium.ttf</string>
<string>Rubik-Black.ttf</string>
<string>Rubik-BlackItalic.ttf</string>
<string>Rubik-Bold.ttf</string>
<string>Rubik-BoldItalic.ttf</string>
<string>Rubik-Italic.ttf</string>
<string>Rubik-Light.ttf</string>
<string>Rubik-LightItalic.ttf</string>
<string>Rubik-Medium.ttf</string>
<string>Rubik-MediumItalic.ttf</string>
<string>Rubik-Regular.ttf</string>
<string>SF-UI-Text-Regular.otf</string>
<string>SanFrancisco.ttf</string>
<string>SanFranciscoBold.ttf</string>
<string>SanFranciscoThin.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Skia.ttf</string>
<string>Times New Roman.ttf</string>
<string>Zocial.ttf</string>
<string>rubicon-icon-font.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>location</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
感谢,但我已经检查了互联网的地位,未知的未知,应用程序没有连接到互联网,也没有问题在Android中,只有在iOS,其中,,我更新我的info.plist也这里 – user3619389
是啊,但同样的问题与我一起提出,但与此代码,我已经解决了它 –
我已经做到了这一点,但它总是去连接的其他条件 – user3619389