I tried to change ip address that I could test on the device.
After changing lines in AppDelegate.m I did rebuild the application and restarted the server (npm start).
As you can see, the server is visible from the browser, everything works fine, but inside the app says that cannot connect to the server.
jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.1:8081/index.ios.bundle?platform=ios&dev=true"];
2016-07-01 13:12:07.949 PropertyFinder[10626:5440580] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
2016-07-01 13:12:09.964 [fatal][tid:main] Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
You also need to add the NSAllowsArbitraryLoads key in Info.plist, next to the NSExceptionDomains key, like this:
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> [...] </dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>