Mobile app for RegioJet.
- Axios - HTTP requests
- Native Base - UI components Use this one only in case there is no alternative, it’s quite unpredictable
- React Intl - translations
- React Navigation
- React Redux
- Redux Persist - persisting Redux state to AsyncStorage
- Redux Thunk - chaining async actions
- NodeJS v8.7.0
Use nvm to switch between NodeJS versions
- Yarn v1.2.1
- React Native dependencies - see "Building Projects with Native Code"
yarn
- install npm packagesreact-native run-ios
– build application and run it in iOS simulatorreact-native run-android
– build application and run it in Android simulator (you need to start the simulator manually)yarn start
- run React Native bundler (use this one if you don’t need to rebuild)yarn test
- run jestyarn eslint
- run eslintyarn prettier
- format your code. Run this command after commit or use the integration to your favorite editor.
Open the project with /ios/RegioJet.xcworkspace
. Do not use /ios/RegioJet.xcodeproj
. This is required by CocoaPods that we use to bundle some native modules.
Use React Native Debugger. Connect to the debugger using Debug JS Remotely in Simulator options (CMD/CTRL+D iOS, CMD/CTRL+M Android). Do not use networking feature of the React Native Debugger. It’s unreliable.
Inspect API calls using Reactotron.
Do not use react-native link
to link all the modules at once. It might break react-native-maps installation.
Link modules one by one using react link <module-name>
.
Copy contents of .env-sample
into .env
and configure proper secret values. Do not add this file to the version control as it may contain credentials etc.
There may be issues with reading environment variables from .env
file. If that’s your case, add them to your system profile.
Create ios/Config.xcconfig
and place FABRIC_API_KEY=xxxx inside.
To the ~/.gradle/gradle.properties
, add
REGIOJET_RELEASE_STORE_FILE=keystore_filename
REGIOJET_RELEASE_KEY_ALIAS=keystore_alias
REGIOJET_RELEASE_STORE_PASSWORD=xxxx
REGIOJET_RELEASE_KEY_PASSWORD=xxxx
See Code signing – Android for more information.
Fastlane workflow contains its own environment variables. Refer to android/fastlane/.env-sample
or ios/fastlane/.env-sample
and create .env
files with proper secrets in the same folders.
# add this to your ~/.bash_profile
export API_BASE_URL='https://dpl-qa-ybus-restapi.sa.cz/v2/restapi'
You can add or remove build environment variables in CircleCI project settings.
master
- development branch, make pull requests to this branch, do not push directly
Every pull request to master
is automatically tested and built using CircleCI. After successful build, apps are uploaded to Fabric Beta. After app upload, developers send invitations for testing.
If you need access, ask colleagues.
Setup the build environment according to the Pre-requisities and environment variables.
Obtain iOS signing certificate and provisioning profile (under the right development team) and Android keystore to be able to build and sign the apps.
- Open
ios/RegioJet.xcworkspace
in xCode - Go to Preferences → Accounts and add your Apple ID you want to use to publish the app.
- Signing certificates and provisioning profiles will be downloaded from the Apple Developer Portal. Just make sure you use the correct Apple ID / Team.
- In the main window, select RegioJet target and go to General tab
- In the Signing (Release) section, select the correct Provisioning Profile. It should be of type AppStore. Make sure correct Team is displayed and Signing Certificate selected (it should be of type Distribution).
- In case you update existing app or just release a new version, make sure to use a keystore that was used to sign the previous versions of the app. Otherwise generate new one.
- Place the keystore to
android/app/
- To the
~/.gradle/gradle.properties
, addWith proper values.REGIOJET_RELEASE_STORE_FILE=keystore_filename REGIOJET_RELEASE_KEY_ALIAS=keystore_alias REGIOJET_RELEASE_STORE_PASSWORD=xxxx REGIOJET_RELEASE_KEY_PASSWORD=xxxx
- Open
ios/RegioJet.xcworkspace
in xCode. - In the main window, select RegioJet target and go to General tab. Under the Identity section, update the version and increment the build number.
- Choose RegioJet Release → Generic iOS Device scheme.
- From the menu bar, select Product → Archive and wait until the archive is built.
- Select the latest archive, click Validate… and follow the process (leave the checkboxes as they are and make sure to select correct certificates).
- After successful validation, click Upload to App Store
- Look for
android { defaultConfig { …
inandroid/app/build.gradle
. Increment the versionCode and update the versionName. - In the
android
folder run./gradlew assembleRelease
. The generated APK can be found underandroid/app/build/outputs/apk/release/app-release.apk
- Go to the Google Play Console under the correct account/organization. Select your app and go to Release management → App releases. Create a new internal, alpha or beta release and upload the recently built
android/app/build/outputs/apk/release/app-release.apk
there and submit the release.
Go to your app in the App Store Connect and click the TestFlight tab. After your fresh build appears there make sure to provide the compliance information if needed. Then you can test the build using the TestFlight iOS app (available in the App Store).
Go to the Google Play Console under the correct account/organization. Look up your release in the App releases section. Add testers if needed.
After the testing, go to the App Store Connect and click the App Store tab. Select the Prepare for Submission item in the iOS App section in the left menu and follow the process.
After the testing, look up your release in the Google Play Console. Click Release to production and follow the process.