Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This page outlines the basic steps to get the Totara Mobile app running in your local development environment. This documentation is aimed at someone with a basic understanding of mobile development, at a minimum.

If you are looking for customisation of considering customising the Totara App, we suggest you finish reading this page, then see more on App customisation. This documentation is aimed at someone with a basic understanding of mobile development, at a minimum.

Requirements

...

The Totara Mobile app is built with React Native and Expo Application Services (EAS).  You will need to set up an account with Expo.  Once EAS has completed the build, it is able to notify you of the result in Slack and/or deliver the built apps for testing.

https://expo.dev


This guide assumes you are already familiar with setting up a mobile development environment.  If you need to set up from scratch, you can find help here: https://reactnative.dev/docs/set-up-your-environment

Local Development

App Requirements

  • node = LTS release v20

  • Java Development Kit (zalu17)

  • Mac OS >= 13.6.x (Ventura)

  • XCode >=

    14

    15.

    1

    2

  • Cocoapods = 1.

    11

    14.3

  • Totara Learn >= 13 (needed only if you need to connect to Totara)

Code repository

Before setting up the git repository, please familiarise yourself with how to get SSH access to our repos.

In the sequence, clone the official repository for partners via SSH.

...

Clone code:

git

...

clone

...

ssh://git@code.totaralms.com/totara-mobile.git
git

...

Adding project local configuration

  1. Duplicate the file src/totara/lib/config.local.example.ts and name the copy as src/totara/lib/config.local.ts.
  2. Override any local settings if required. If no changes are required the default Totara setup is used.

Adding Firebase configuration

The basic Firebase setup can be done by duplicating the files and renaming as follows:

...

checkout feature/react-native-expo-replatform

Install EAS tools:

npm install -g eas-cli

Install dependencies:

npm install

Prepare Firebase configuration files:

cp GoogleService-Info.example.plist

...

GoogleService-Info.plist

This will be sufficient to prepare you for development of features not related to Firebase. If you require further Firebase setup, see App customisation.

Dependencies

Javascript dependencies

Install all the dependencies by running the following in the root directory:

Code Block
languagebash
titleInstall
yarn

Native dependencies

Install iOS native dependencies:

Code Block
titleiOS dep
cd ios && pod install
Note

There's no extra step for Android

Running the app

You can either plug in a real device or leave it for running in a device simulator. The following commands are enough to run the app. Run the relevant command from the root directory of the project.

...

languagebash
titleRun on terminal

...

cp google-services.example.json google-services.json

Run the app:

npm run start

App Builds

Requirements

  • Sign up for Expo.dev for automated builds (start with the Free plan)

  • Sign up for Appetize.io for browser-based simulator testing (Optional - start with a Free plan)

Expo Setup

You will need to set up a new project in Expo and fill in the fields in app.config.js

  • Slug

  • Name

  • Version

  • EAS Project Id

You will also need to set up the following secrets in Expo

  • GOOGLE_SERVICES_FILE_ANDROID

  • GOOGLE_SERVICES_FILE_IOS

  • SLACK_WEBHOOK_URL (Optional - for Slack build notifications)

  • APPETIZE_API_KEY (Optional - for Appetize testing)

  • APPETIZE_IOS_APP_PUBLIC_KEY (Optional - for Appetize testing)

  • APPETIZE_ANDROID_APP_PUBLIC_KEY (Optional - for Appetize testing)

Expo secrets

...

Starting a Build

To start a build in Expo using EAS:

npx eas build --platform all --profile development