This is a skeleton React Native App for Wagtail sites. It's based on an app by Josh Barr from Springload for New Zealand Festival. It speaks to the API on the live festival website.
- Follow the React Native guide to set up the tools you'll need in your developer environment.
git clone git@github.com:tomdyson/react-native-example.git
- Open react-native-example/ios/Festival.xcodeproj in Xcode
To develop on the iOS simulator, the default settings in AppDelegate.m
(xcode)
will be fine:
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
For developing on a device rapidly, you can change localhost
above to your machine's local IP address, eg:
jsCodeLocation = [NSURL URLWithString:@"http://10.0.0.96:8081/index.ios.bundle?platform=ios&dev=true"];
note: This will only work with real devices, not with builds targeting the iOS simulator.
When you want to develop/test on a real device, it's easiest to bundle the JS with the app. You can do that by uncommenting this line:
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
To test on a real device, you'll need to have xCode signed in to the Apple Developer Programme.
There's details in the UPM. Look for mobile@springload.co.nz
.