/festival-squad-app

An old app I was developing using React Native and Firebase. It's no longer in development, but feel free to reference my code if it's of any use to you!

Primary LanguageJavaScriptOtherNOASSERTION

[ARCHIVED] Festival Squad - iOS & Android App

This is an old app I was developing using React Native and Firebase. It's no longer in development, but feel free to reference my code if it's of any use to you!

Project Docs

Code Stuff

Installation

$ npm install
$ cd ios && pod install

Run on iOS

This should auto-launch an iPhone emulator (keyword should).

$ react-native run-ios

Run on Android

This requires an Android Emulator to already be running.

  • Create a new device in Android Studio > AVD Manager
  • Name it something simple, I chose pixel2

The device should now be able to be run manually from AVD Manager or from the Terminal with emulator @pixel2

$ react-native run-android

If you encounter any errors, try a rebuild:

cd android && ./gradlew clean && cd .. && react-native run-android

Issues and Solutions

  • permission denied: gradlew - cd android && chmod +x gradlew
  • Could not install the app on the device, read the error above for details. - cd android && chmod 755 gradlew - facebook/react-native#8868
  • grpc cpu.h file not found - downgrade node. v8.5.0 works.
  • Debugger UI fails to connect at 10.2.2.2 - use localhost instead of that IP. Not sure why the emulator doesn't open the right url automatically.

Troubleshooting Android Build Errors (Missing Package Links)

If the error looks like the Android build is failing to find a newly added dependency, it may not have been imported correctly into the project. Running $ react-native-link <package> is supposed to work, but sometimes it doesn't. So go through and manually make sure the the following lines are in place (using Firebase as an example):

In android/app/build.gradle:

compile "com.google.firebase:firebase-core:11.6.0"`

At the top of android/app/src/main/java/com/vybe/MainApplication.java:

import io.invertase.firebase.RNFirebasePackage;

In getPackages() near the bottom of android/app/src/main/java/com/vybe/MainApplication.java:

new RNFirebasePackage(),

Notes/TODO/Questions

  • Firebase Firestore authentication / security: https://firebase.google.com/docs/firestore/security/overview
  • Firebase offline sync: https://firebase.google.com/docs/firestore/manage-data/enable-offline
  • Paging for all routes that may eventually need it (i.e. user friends)
  • I want to track a list of events I'm going to, but I also want a # of users going for each event. Currently writing transactions to store rsvp to user object and increment counter on event object. This means data modified / deleted from user record would create concurrency problems. But maybe this should fully tie this to the event object? (this is why we want to use a SQL db...relational data needs a relational db)
  • What can we use cloud functions for?
  • Figure out why android/gradlew clean doesn't work. Have to cd android && ./gradlew clean

Future Stuff, References, More Reading

Libraries

Native Boilerplate Components

Resources

Examples & Documentation