Too Many Men is an iOS, Android and web application for beer league hockey teams.
This repository is the React Native Expo frontend which consumes the Ruby on Rails JSON API whose source is here and is hosted here.
yarn install
yarn start
yarn test --collectCoverage
open coverage/lcov-report/index.html
Typically, to deploy, we only need to do git push [remote] main
because a github workflow automatically pushes out Over-The-Air (OTA) updates to production when all the automated checks succeed in GitHub Actions.
Quick note: There is a web version of this app which the test suite does not cover (for reasons which we intend to document) that is also deployed whenever a new version of the main branch is pushed to GitHub. We don't have users that are dependent on the web app, but it'd be nice thing to do, if, before you push to main, you take a quick peek at the web app on your local machine to see if it looks like it's still working 😬 That sounds bullet proof ... right? 🤷
However, there will be times when you need to (1) create a new build of the app and (2) submit it to the app stores before sending any Over-The-Air (OTA) updates.
You'll need to create a new build of the app when you change any native code. For exmaple, if you add new native permissions, like requesting access to the user's camera or contacts, or requesting permission to send them push notifications, or adding a deep linking url scheme to the app, you'll need to create a new build and submit it to the stores before sending over the air updates to be applied atop those code changes. There's more detail about how to know when a new build is required before sending additional OTA updates in Expo's docs, here.
You'll definitely need a new build if any of the following are true.
- You're changing any Java, Kotlin, Swift or Objective-C code
- You're adding a dependency whose docs instruct you to add a cocoapod
- You're editing the
app.json
file
app.json
file in the expo.version
key!
Running eas build
takes a lot of time (~10 minutes per build and possibly hours waiting in the build queue) and costs money. App Store Connect and the Google Play Developer Console (the places where builds are uploaded to then be used by either internal testers or to be distributed in the stores) won't permit uploading a build that has the same version number as another build which has already been uploaded. If you forget to bump the version number, you'll have to create another build, costing time and money.
It's not as bad as getting Covid, but it's not our favorite thing 🫠
First, bump the version number in app.json
's expo.version
key.
eas build --profile preview
You can also pass an optional --platform ios|android
flag.
First, bump the version number in app.json
's expo.version
key.
eas build --profile production
You can also pass an optional --platform ios|android
flag.
First, create a new build (remembering to bump the version number in app.json
). Then run the submit command.
eas submit
eas submit
will walk you through the process of uploading your new build(s) to the applicable store(s).
Over the air updates go out fast (generally, in less than a minute) after running the following command in your terminal. Given the users consents, over the air updates get applied the very next time the user foregrounds (opens) the app. They don't require waiting for a build to complete (which can take minutes to hours) or waiting for a human at Google or Apple to review the changes (which can take days).
Over the air updates make working in the mobile ecosystem tolerable 🥳
These OTA updates (with --branch preview
) will be applied to builds created by eas build
which have the --profile preview
flag set.
eas update --branch preview --auto
The --auto
flag tells eas to use the git commit message as the OTA update deploy's message (saved in the expo dashboard).
Deploying OTA updates to Production (to be applied to binaries on the iOS App and Google Play Stores)
eas update --branch production --auto
The --auto
flag tells eas to use the git commit message as the OTA update deploy's message (saved in the expo dashboard).