This is a simple mobile app example for posting comments in React Native. It connects the API at https://www.reactrails.com. You can see a web client there, plus links to the source.
- Install the latest version of Xcode from AppStore or https://developer.apple.com/download/ (Apple ID required)
- Install the latest version of Android Studio from https://developer.android.com/studio/index.html
- Install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
- Install NodeJS stable
nvm install node
- Install React Native and recommended packages
npm install -g react-native-cli
brew install watchman
brew install flow
- Install npm dependencies
npm i
- Install Native Dependencies (maybe)
- vector-icons
Besides adding vector-icons
- App name
- Icons, both ios and android
Android Keystore
- Edit
android/app/src/main/AndroidManifest.xml
- Currently connecting by default to https://www.reactrails.com/. Be aware of that!
- The url can be changed app/api/index.js. Keep in mind, that Android emulator is
a separate Virtual Machine with its own localhost binding. To make the api available under that emulator,
you will have to use ip address of your computer, which can be seen by running
ifconfig
in the shell
react-native run-ios
- Check that installed build tools match gradle config of android project:
- In gradle config (app > android > build.gradle), search
buildToolsVersion
- Run
android sdk
from bash and find installed build tools version there
- Run emulator from Android studio or
emulator @<version>
from bash (you can find installed version by runningemulator -list-avds
from bash) - From project folder run
react-native run-android
Testing framework uses mocha + enzyme, to run tests type
npm test
This projects uses Eslint with React and React Native rules. To run linters type
npm run lint
This projects uses Eslint with React and React Native rules. To run linters type
npm run flow
Can be found in docs
folder. See Introduction to start.