I'm using React-Native, when I run the AwesomeProject with Xcode and iPhone simulator everything works well, but when I connected my iPad and built the project on my iPad I receive an error on the iPad when the app starts:
"Could not connect to development server. Ensure node server is running. The operation couldn't be completed (NSURLErrorDomain error -1004)".
I also ensured that the node package is running. I even restarted Xcode and started it all over with running npm start.
Could you please assist?
Try this. Open another terminal and run, react-native start — reset-cache. Then run, react-native run-android on your current terminal.
In other words, with React Native we can create an app that can support not only iPhone or Android phones but also iPad, Android tablets.
React Native combines the best parts of native development with React, a best-in-class JavaScript library for building user interfaces. Use a little—or a lot. You can use React Native today in your existing Android and iOS projects or you can create a whole new app from scratch.
On your AppDelegate.m you have to update the jsCodeLocation
and replace localhost
with your machine ip address.
Either that or bundle the compiled source into your application, which is commented as option 2 on AppDelegate.m
as well. You download the compiled code, and add it to your Xcode project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With