- Flutter. Make sure all checks pass when you run
flutter doctor
- Android Sdk Tools
- An emulator or phyiscal device. This app isn't configured to run in the browser.
File | Directory |
---|---|
google-services.json | app directory under android folder (android/app/ ) |
google-services.json | app/src/airqodev directory under android folder (android/app/ )(For the staging environment) |
firebase_app_id_file.json | Android folder (android/ ) |
key.properties | Android folder (android/ ) |
local.properties | Android folder (android/ ) |
.env.dev | App root directory (this directory) |
.env.prod | App root directory (this directory). Create an empty file named .env.prod . |
airqo-dev-keystore.jks | Place it in any secure directory on your computer |
GoogleService-Info.plist | airqo directory ios/config folder (ios/config/ ) |
GoogleService-Info.plist | airqodev directory under ios/config folder (ios/config/ )(For the staging environment) |
- Change
sdk.dir
andflutter.sdk
to point to the correct paths for your android Sdk anf flutter respectively - Change
storeFile
variable inkey.properties
file to point to where you putairqo-dev-keystore.jks
. For example ifairqo-dev-keystore.jks
is located under/Users/example/
thenstoreFile=/Users/example/airqo-dev-keystore.jks
-
It's important to first read our guidelines here.
-
Thereafter, proceed to create your own necessary configuration files. These include;
-
Add an
.env file
, which contain credentials in key-value format for services used by the app. For development, save the file as.env.dev
while for production, save it as.env.prod
.-
Here's what your .env file would look like;
AIRQO_API_URL= https://api.airqo.net/api/v1/ AIRQO_API_TOKEN = Get this token by following the respective links below. SEARCH_API_KEY = AIRQO_API_USER_EXISTS_URL = https://europe-west1-airqo-250220.cloudfunctions.net/airqo-app-check-user FAV_PLACES_COLLECTION = KYA_COLLECTION = USERS_NOTIFICATION_COLLECTION = USERS_ANALYTICS_COLLECTION = USERS_COLLECTION = USERS_KYA_COLLECTION = USERS_PROFILE_PICTURE_COLLECTION = PREF_ON_BOARDING_PAGE = SENTRY_DSN =
-
Get the following keys by following documentation from the respective sources;
-
Use the corresponding database collection names for the collection variables.
- You can create a collection using the following guide.
-
We restricted the search API to only call 3 other APIs, the Geocoding API, GeoLocation API, and the Places API. It should therefore have access to those above APIs. You can then get the api key from the GCP credentials page.
-
-
Your project structure should be similar the the following after adding all the required configuration files.
Run the command below to get your SHA-1 signing-certificate fingerprint. Share the Key with an AirQo team member to add it to the application restricted fingerprints.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
flutter run
task r
flutter run --flavor airqodev -t lib/main_dev.dart
flutter run --flavor airqodev -t lib/main_dev.dart --release
flutter run --flavor airqo -t lib/main.dart
flutter run --flavor airqo -t lib/main.dart --release
Install the Shorebird CLI (Refer to docs.shorebird.dev for the OS specific commands)
Login using shorebird command
shorebird login
This creates file shorebird.yaml
shorebird init
shorebird release android --flavor airqo
iOS(alpha)
shorebird release ios-alpha --flavor airqo
To run on a device or emulator
shorebird preview --flavor airqo -t lib/main.dart
To run on a device or emulator
shorebird patch --flavor airqo -t lib/main.dart
- Fastlane is triggered to update FirebaseApp app distribution every time a PR is merged
- To modify the workflow, open the .github/workflows folder, and navigate to deploy-mobile-android-to-firebase-app-distribuion.yml
- The uploaded artifact can also be downloaded from the summary of the workflow as a zip folder and tested.
- After making changes locally, specify what feature you wish to be tested in mobile/android/release-notes.txt and open a pull request
- To create a final build that can be used for production, increment the version number in pubspec.yaml file
bash upgrade-dependencies.sh
dart run build_runner build --delete-conflicting-outputs
dart fix --dry-run && dart fix --apply && dart format lib/
flutter pub run dart_code_metrics:metrics analyze lib --reporter=html
flutter pub run dart_code_metrics:metrics check-unused-files lib
flutter pub run dart_code_metrics:metrics check-unused-code lib
flutter build appbundle --build-name 1.0.0 --build-number 20025 --flavor airqo
flutter build ipa --build-name 1.0.0 --build-number 1 --flavor airqo
flutter build appbundle --obfuscate --split-debug-info=${PWD}/obfuscate
flutter build ipa --obfuscate --split-debug-info=${PWD}/obfuscate
flutter build appbundle [--analyze-size]
flutter build ipa [--analyze-size]
flutter gen-l10n
We strive to follow an established industry standard for mobile application security from the OWASP (the Open Web Application Security Project), The OWASP Mobile Application Security Verification Standard (MASVS) provides a set of baseline security criteria for developers. For a detailed security guide. Check out the MASVS Level 1 requirements.