readServiceAccount static method

Future<void> readServiceAccount()

Implementation

static Future<void> readServiceAccount() async {
  // On web, service account assets are publicly accessible via the browser.
  // Skip loading — push notifications are handled via Cloud Functions.
  if (kIsWeb) {
    AppConfig.logger.t("readServiceAccount skipped on web (security)");
    return;
  }

  AppConfig.logger.t("readServiceAccount");
  try {
    String jsonString = await rootBundle.loadString(DataAssets.serviceAccountJsonPath);
    serviceAccount = jsonDecode(jsonString);
    AppConfig.logger.t("Service Account Loaded (${(serviceAccount as Map).length} keys)");
  } catch (e, st) {
    NeomErrorLogger.recordError(e, st, module: 'neom_core', operation: 'readServiceAccount');
    return;
  }
}