Skip to content
FEUC mobile app
JavaScript Objective-C Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__
android
ios
resources
src
.babelrc
.buckconfig
.eslintrc.js
.flowconfig
.gitattributes
.gitignore
.watchmanconfig
README.md
app.json
index.android.js
index.ios.js
jsconfig.json
package.json
yarn.lock

README.md

FEUC Mobile

styled with prettier

Built with React-Native.

AppStore PlayStore

By Patricio López Juri.

Requisites

  • Node.js 6.9 LTS or newer
  • Yarn
  • XCode and Android environment

Development

Clone this repository:

git clone https://github.com/open-source-uc/FEUC-mobile.git
cd FEUC-mobile

Install dependencies:

yarn install

Create a .env file for the following configuration variables:

FEUC_API_URL=https://feuc.lopezjuri.com
SIGNAL_APP_ID=...
GOOGLE_MAPS_API_KEY=...
GOOGLE_ANALYTICS_ID=...

This file is ignored by default on git, but it's included on the builds and can be reversed engineered.

Create development server:

yarn start

It is recommended to have an IDE with an ESLint plugin. To run the linter:

yarn run lint

To quick-fix warnings:

yarn run lint -- --fix

iOS

Run an iOS emulator with:

yarn run ios

Run on device with:

yarn run ios -- --device

It's possible that you will need to install ios-deploy globally:

yarn global add ios-deploy

Add the --configuration Release flag to run a production build.

Troubleshooting

Make sure to have enabled:

...
  <key>NSAppTransportSecurity</key>
  <dict>
-   <key>NSExceptionDomains</key>
-   <dict>
-     <key>localhost</key>
-     <dict>
-       <key>NSExceptionAllowsInsecureHTTPLoads</key>
-       <true/>
-     </dict>
-   </dict>
+   <key>NSAllowsArbitraryLoads</key>
+   <true/>
  </dict>
...

Android

Run an Android emulator with:

yarn run android

Troubleshooting

See the console on a device with:

adb logcat *:S ReactNative:V ReactNativeJS:V

To show every log:

adb logcat
Colors

Change the app colors in android/app/src/main/res/values/styles.xml.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">#43D1C0</item>
    <item name="colorPrimaryDark">#34A79D</item>
    <item name="colorAccent">#F2F2F2</item>
</style>

Production

To create a npm and git version, commit everything on the master branch and then:

npm version major|minor|hotfix

iOS

  1. Open ios/UCMaps.xcodeproj with XCode.
  2. Go to Project -> Scheme -> Edit Scheme (cmd + <) and make sure you're in the Run tab from the side, and set the Build Configuration dropdown to Release.
  3. Select Generic iOS Device
  4. Go to Product -> Archive

The final file should appear on the Organizer.

See: http://stackoverflow.com/a/34982804/3416691

UNTESTED:

react-native run-ios --configuration Release

Android

Generate a .keystore if you do not have one:

# Generate key
keytool -genkey -v -keystore feuc-release.keystore -alias feuc -keyalg RSA -keysize 2048 -validity 10000

# Move it to ./android/app/
mv feuc-release.keystore ./android/app/feuc-release.keystore

Edit ~/.gradle/gradle.properties:

nano ~/.gradle/gradle.properties
FEUC_RELEASE_STORE_FILE=feuc-release.keystore
FEUC_RELEASE_KEY_ALIAS=feuc
FEUC_RELEASE_STORE_PASSWORD=...
FEUC_RELEASE_KEY_PASSWORD=...

Compile the app with:

cd android
./gradlew assembleRelease

The signed .apk will be located at:

app/build/outputs/apk/app-release.apk
You can’t perform that action at this time.