A collection of POCs, Samples code, created by PT. Mitrais CDC Mobile's Software Engineers (www.mitrais.com)
###HOW TO - Get the samples into your local machine & setup your machine before running the samples.
- Ensure that you have setup
nodejs
&git
client in your machine. - Ensure that you have setup
react-native-cli
in your machine. If not run this command to install itsudo npm install -g react-native-cli
. - Open a terminal window and run this command
git clone https://github.com/mitrais-cdc-mobile/react-pocs.git
to pull whole POC project files into your machine. - Change directory to the POC project folder you want to run.
- Run this command to install
react-native
library in the POC Projectnpm install react-native@^<LATESTVERSIONOFRN>
where can be replaced with version you could look in this following link: https://facebook.github.io/react-native/versions.html example: if the latest version of RN is 0.24.1 then the npm command should benpm install react-native@^0.24.1
- Follow the steps in next sections based on mobile platform you intend to run the sample to.
- Ensure that you have installed android SDK in your machine and these correct components have been installed:
- Tools: Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools (All versions)
- API 23, 22, 21, 20, 19: SDK Platofrm
- Extras: Android Support Repository, Android Support Library, Google Play Services, Intel x86 HAXM Installer.
- Ensure that you have setup ANDROID_HOME environment variable which points to correct android sdk's path.
- Back to your POC project in terminal window, change directory to
./android
subfolder. - Run this command to change the
gradlew
file become executable:chmod 755
. - Run this command to install required dependencies by the android app:
gradlew InstallDebug
. The process will take a while to finish. - Change directory to the POC Project's root directory then run
npm start
- Open a new terminal which still point to the POC Project's root directory then run
react-native run-android
command.
- Run this command to clean up the contents of ios build directory:
rm -rf ios/build/**
- Run
npm start
command. This will run react native's packager server. - Open a new terminal which still point to the POC Project's root directory then run
react-native run-ios
command.