Crowdbotics React Native scaffold
After cloning this repo, you will need to install the dependencies:
cd ProjectName
yarn install
Then, you need to install the Podfile:
cd ios
pod install
Installing all dependencies in for development
Please follow this guide and install the correct dependencies for your current OS and the OS that you want to build (iOS or Android)
https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies
Setup
Google config
There is two files that you need to edit to make work the push notifications, google sign up and other Google Services:
ios/GoogleService-Info.plist
android/app/google-services.json
You need to create a project in firebase console and update all the credentials on both files (current files have invalid credentials)
Also, you will need to modify your URL types in Info
, follow this instructions:
Finally, you will need to add GoogleService-Info.plist
(file reference) to your iOS project via xcode.
- Open
aline_0323_dev_20903.xcodeproj
in xcode. - Go to main target > Build Phases > Copy Bundle resources
- Tap un add button
- Search the
GoogleService-Info.plist
insideios
folder. - Make sure you can see
GoogleService-Info.plist
inside in xcode. Like this:
Running with React Native CLI
Running android simulator
- Activate android emulator following this instructions
react-native run-android
from project home folder
Running iOS simulator
- Go to
ios
folder and runpod install
(if you don't have pod installed, follow this instructions ) - Run
react-native run-ios
from project home folder.
If you find any compiling problems, try to clean your cache. From the home app folder run:
cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
and
cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
Running with Fastlane
Fastlane makes testing, building, and deploying apps easier.
Install fastlane globally (npm i -g fastlane
or yarn i -g fastlane
).
Android and iOS dependencies are the same as React Native CLI.
All fastlane commands are run from the platform directory. For example, Android
commands must be run from android/
. Fastlane should be executed using bundle exec
to ensure dependencies are managed correctly.
The commands for Android and iOS are the same:
- Run tests:
bundle exec fastlane tests
- Local build:
bundle exec fastlane build
- Build and upload a beta (requires signing):
bundle exec fastlane beta
- Build or promote a release:
bundle exec fastlane deploy
Android
Publish an Android app you must first create an app in the Play Console and
manually upload an APK. After the first upload run bundle exec fastlane supply init
from android/
to sync with the Play store. All future releases will be
uploaded automatically.
Android uses tracks. A beta release will build the app and upload to the beta track. Deploying will promote from beta to production.
iOS
CB developers must follow fastlane's codesigning guide for using match. Match will automatically sign iOS builds.
New CB developers should get access to the codesigning repo and run bundle exec fastlane match development
from ios/
.
Not a CB developer? Create an Apple developer and follow the instructions on codesigning guide to setup your certificates.
React Native Web
It is to build and deploy your app as web platform which run on browser
Please follow the steps
- please run
yarn web-build
- the web_build folder is generated and copied to backend/ automatically. please commit/push the web_build folder to git
Known Issue
- the icons is not rendering properly for web app. It will come in next release.
- To do it yourself, you can update webpack config to handle ttf files using url-loader (or file-loader) so that icons can be injected to CSS/stylesheet and showed on web