Skip to content

massenergize/massenergize-mobile-application

Repository files navigation

MassEnergize Community App

This repository contains the code for the MassEnergize community app, a mobile companion to the Massenergize community portal. The app mirrors the functionality of the web portal using the React Native framework. This project is currently under ongoing development.

Getting started

Follow the instructions below to run the app on a simulator on your local machine for testing and development. The following instructions are for Mac users targeting the iOS simulator. Further instructions will be added as needed.

0. Set up the local MassEnergize API

Follow the instructions in the Installing Local API and Database guide to run the backend API on your own

1. Clone the repository

Navigate to the directory where you want the code to be installed and clone the repository with git clone massenergize/massenergize-mobile-application.

2. Install required software

a. Node and Node Package Manager (npm)

Node is a JavaScript runtime used to run the app and npm is its package manager, used to install and run external libraries used in the app.

Check for an existing verions using node -v. If none exists, install using brew install node.

b. XCode

XCode is an IDE used specifically for development targeting Apple operating systems, including iOS. It will be used to run the iPhone simulator and install the app.

XCode can be found on the Mac App Store.

3. Installing libraries

a. Install Node modules

In the project root directory, run npm install to install the required modules.

b. Installing CocoaPods

CocoaPods is a package manager which we will use to install iOS specific packages.

Check for a Ruby installation using ruby -v. If none is found, install it with brew install ruby.

With Ruby installed, install CocoaPods with sudo gem install cocoapods.

Finally, navigate to the ios directory and install the required pods using pod install.

4. Additional and modified files

a. GoogleService-Info.plist

Obtain a copy of the appropriate GoogleService-Info.plist file from either the project's Firebase Console, the MassEnergize Slack, or by contacting one of the contributors to this repository. Add the file to ios directory.

b. config.json

Open app/api/config.json and change IS_LOCAL to true and both other options to false:

{
  "IS_LOCAL": true,
  "IS_PROD": false,
  "IS_CANARY": false,
  "BUILD_VERSION": "X.X.X"
}

5. Run the app

Run the app by running npm start in the project root directory and pressing i when prompted.

That's it! Please reach out to William Soylemez or Moizes Almeida by email or Slack with any questions.

Uploading to App Store Connect

To distribute the app on the Apple App Store or on Testflight, we need to upload the app archive to App Store Connect.

1. Archive the app

In XCode, switch the target device to "Any iOS Device (arm64)", then click on Product -> Archive.

2. Upload

Once the app has finished building, a popup should open displaying all app archives (if not, open it under Window -> Organizer). Select the verison you wish to distribute, click on "Distribute App", and follow the instructions.

Switching between dev and prod backend

The instructions above will configure the app to use the developer (local) backend. To use the production backend, follow these steps:

1. Update config.json

Switch the API config to use the Canary (or Prod) API:

{
  "IS_LOCAL": false,
  "IS_PROD": false,
  "IS_CANARY": true,
  "BUILD_VERSION": "X.X.X"
}

2. Update GoogleService-Info.plist

Replace the contents of ios/GoogleService-Info.plist with a production version that can be found in the ME slack here or by reaching out to a ME team member.

3. Update url scheme in XCode

Open the updated GoogleService-Info.plist and copy the value under REVERSED_CLIENT_ID. Open XCode and click on the project in the left-hand navigator. Ensure the correct project is picked under "targets" then navigate to "info" and open "URL Types". Replace the value in "URL Schemes" with the ID you just copied from GoogleService-Info.plist.

4. Copy the Firebase client id into Info.plist

Copy the Firebase client ID, the last section of the REVERSED_CLIENT_ID from the section above, into the first section of the GIDClientID field of ios/MassenergizeAppV2/Info.plist.

5. Copy the Firebase client Id into rootwrapper

Lastly, open app/pages/RootWrapper.js and update the lines under GoogleSignIn.Configure with the same part of the REVERSED_CLIENT_ID as the last step:

GoogleSignin.configure({
  webClientId:
    '*YOUR_CLIENT_ID*.apps.googleusercontent.com',
});

With that, the app should use the production backend. Please reach out to William Soylemez with questions!


This is a new React Native project, bootstrapped using @react-native-community/cli.

About

MassEnergize Mobile Application with React Native - NO EXPO!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages