Project

General

Profile

Bug #3381

In-app update prompt via Firebase Remote Config (App Distribution / TestFlight)

Added by Kunal Jangid 1 day ago.

Status:
New
Priority:
Normal
Assignee:
Start date:
10/26/2026
Due date:
% Done:

0%

Estimated time:

Description

Overview

Add an in-app update prompt to ChargeWatch so internal users are notified whenever a new build is released. The logic is the same as evcsms-mobile (Firebase Remote Config). Since ChargeWatch is not on Play Store / App Store, the "Update Now" action redirects to the internal distribution channels:

  • Android → Firebase App Distribution (App Tester)
  • iOS → TestFlight

Behaviour

  • On Login / Home screen, the app fetches Remote Config and compares the installed version with the latest version.
  • An update is shown when:
    • remote version > installed version, or
    • version is the same and remote build number > installed build number
  • Optional update → dismissible dialog ("Later" / "Update Now"), shown once per session.
  • Force update → non-dismissible dialog (back button blocked). Can be enabled for everyone or only for specific user IDs.
  • Dev flavor (com.chargejet.watch.app.dev) reads *_dev keys, Live flavor (com.chargejet.watch.app) reads keys without suffix.

Remote Config Keys (Firebase project: charge-watch)

Live key Dev key Type Example Purpose
android_latest_version android_latest_version_dev String 1.0.2 Latest Android version
android_latest_build android_latest_build_dev Number 45 Latest Android build (0 = ignore)
ios_latest_version ios_latest_version_dev String 1.0.2 Latest iOS version
ios_latest_build ios_latest_build_dev Number 45 Latest iOS build (0 = ignore)
force_update force_update_dev Boolean false Force update for all users
force_update_user_ids force_update_user_ids_dev String 12,34 Force update only for these user IDs
update_message update_message_dev String Bug fixes and improvements Message shown in dialog
android_update_url android_update_url_dev String https://appdistribution.firebase.dev/i/xxxx App Distribution tester link
ios_update_url ios_update_url_dev String itms-beta://beta.itunes.apple.com/v1/app/<AppleID> TestFlight link

Technical Changes

  • New: lib/services/update_service.dart – Remote Config init, version + build comparison, optional/force dialogs, redirect logic
  • New: lib/constants/remote_config_keys.dart – Remote Config key constants
  • home_screen.dart, login_screen.dart – trigger update check after first frame
  • pubspec.yaml – added firebase_remote_config
  • ios/Runner/Info.plist – added itms-beta to LSApplicationQueriesSchemes
  • AndroidManifest.xml – added https VIEW intent in <queries>
  • Branch: feature/in-app-update-prompt (commit 1067cc6)

Pending / Setup

  1. Create the above parameters in Firebase Remote Config (charge-watch project) for both Live and Dev.
  2. Generate App Distribution invite links (Android) for Live and Dev tester groups.
  3. Get Apple ID of both iOS apps from App Store Connect → App Information, and set ios_update_url / ios_update_url_dev.
  4. Push branch and raise PR.

Testing Checklist

  • [ ] Dev: set android_latest_build_dev = 45 (current build 44) → optional dialog appears
  • [ ] "Later" closes dialog; dialog not shown again in same session
  • [ ] "Update Now" opens App Tester / App Distribution link (Android)
  • [ ] "Update Now" opens TestFlight (iOS)
  • [ ] force_update_dev = true → dialog cannot be dismissed (incl. back button)
  • [ ] force_update_user_ids_dev with a specific user ID → force dialog only for that user
  • [ ] Version/build equal or lower → no dialog
  • [ ] No internet / Remote Config fetch fails → app opens normally, no crash
  • [ ] Repeat for Live flavor after release

Notes

  • On every release, update Remote Config version/build and versionCode / versionName in android/app/build.gradle flavors. Android reports this hardcoded value.
  • Release builds may take up to 5 minutes to pick up new Remote Config values.

No data to display

Also available in: Atom PDF