- Run in the project directory:
sudo npm install -g react-native-cli
sudo gem install cocoapods
npm install rnpm -g
npm i
cd ios
pod install
- Now you have to set up your in-app purchases in iTunes Connect. Follow this tutorial to get easy explanation.
- Run in the root directory
react-native bundle --entry-file index.ios.js --bundle-output ios/main.jsbundle --minify=true --platform=ios --assets-dest=./ --dev=false
- See Using offline bundle
- Do not forget to switch the line ->
AppDelegate.m
👍 - Open XCode
Do what is written paragraph 2
- Open project
mentor2/ops/Mentor2.xcodeproj
- Start on your phone
- Run in the root directory
react-native bundle --entry-file index.ios.js --bundle-output ios/main.jsbundle --minify=true --platform=ios --assets-dest=./ --dev=false
- Open XCode.
- Open project
mentor2/ops/Mentor2.xcodeproj
- Run in the simulator:
cmd + R
For testing your in-app purchases you should run the app on an actual device. Using the iOS Simulator will always fail.
-
Set up a test account ("Sandbox Tester") in iTunes Connect. See the official documentation here.
-
Run your app on an actual iOS device:
- Run the react-native server on the local network instead of localhost.
- Connect your device to Mac via USB
- Select it from the list of available devices and simulators in the top bar (it's next to the build and stop buttons).
- Open the app and buy something with your Sandbox Tester Apple Account!