Skip to main content

App Setup

Follow these steps to get started with your Omi. Don't want to bother with code? Use our official version on Apple/Google store

Prerequisites

Before starting, make sure you have the following installed:

Build the app automatically

Video Walkthrough

Building the app automatically means setting up your environment to use Omi's Development backend. That makes it much easier for you to get started - with just one command!

This is the best way to get started, make changes to the app, and build apps on Omi.

Alternatively, you can build the app manually (see below) - which allows you to use your own backend, etc.

1. Navigate to the app directory:

cd app

2. Build the app for iOS:

bash setup.sh ios

3. Build the app for Android:

bash setup.sh android

If you use windows, open Git Bash, navigate to /app and type bash setup.sh android

4. Run app in simulator:

Now that we've built the app, we can run it in the simulator. Open the app in Xcode (open folder app/ios) or Android Studio (open folder app/android) - then just hit the run button!

Alternatively, run flutter run --flavor dev in terminal

Build the app manually:

Setup manually is useful if you want to build the app to use your own backend.

1. Upgrade Flutter

Before proceeding, make sure your Flutter SDK is up to date:

flutter upgrade

2. Get Flutter Dependencies

From within app directory, install flutter packages:

cd app
flutter pub get

3. Install iOS Pods

Navigate to the iOS directory and install the CocoaPods dependencies:

cd ios
pod install
pod repo update

4. Environment Configuration

Create .env using template .env.template

cd ..
cat .env.template > .dev.env

5. API Keys

Add your API keys to the .env file. (Sentry is not needed)

6. Run Build Runner

Generate necessary files with Build Runner:

dart run build_runner build

7. Setup Firebase

  • Follow official Firebase Docs till Step 1
  • Run the following command to register the prod flavor of the app. The command will prompt you to select configuration type; under it, select Target and then Runner
    flutterfire config --out=lib/firebase_options_prod.dart --ios-bundle-id=com.friend-app-with-wearable.ios12 --android-app-id=com.friend.ios --android-out=android/app/src/prod/  --ios-out=ios/Config/Prod/
  • Similarly for dev environment
    flutterfire config --out=lib/firebase_options_dev.dart --ios-bundle-id=com.friend-app-with-wearable.ios12.develop --android-app-id=com.friend.ios.dev --android-out=android/app/src/dev/  --ios-out=ios/Config/Dev/
  • Generate SHA1/SHA256 Keys for your Keystore and add them to Firebase. Follow the steps mentioned in this StackOverflow answer or the Official Docs. This is required for Firebase Auth through Google OAuth to work.

If you're facing auth issues running the app, enable Google/Apple sign-in in Firebase. Go to the Firebase console and select your project. In the left-hand menu, click on "Authentication." On the "Sign-in method" tab, scroll down to the "Sign-in providers" section. Click on the "Google" sign-in provider. Click the "Enable" switch to enable Google Sign-In for your Firebase project.

8. Run the App

  • Select your target device in Xcode or Android Studio.
  • Run the app.

Having troubles? Join Discord and search your issue in help channel