Wire app-side Firebase push notifications

- Rename Android package com.example.frontend -> net.oottsecurity.app
  (namespace, applicationId, MainActivity), and enable core library
  desugaring required by flutter_local_notifications
- Configure Firebase from a committed lib/firebase_options.dart (client
  identifiers, not secrets) instead of native config files; initialize the
  push service with explicit options
- iOS: add Runner.entitlements (aps-environment) wired via CODE_SIGN_ENTITLEMENTS
  for the Runner target, and UIBackgroundModes remote-notification in Info.plist
- gitignore the unused native Firebase config files defensively

dart analyze clean; 145 frontend tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-06-08 14:46:55 -04:00
co-authored by Claude Opus 4.8
parent d81eba3b37
commit 44ec383744
8 changed files with 93 additions and 7 deletions
+7 -3
View File
@@ -3,6 +3,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import '../firebase_options.dart';
import 'oott_api.dart';
/// Per-device push enable/disable, behind an interface so the settings UI can be
@@ -55,10 +56,13 @@ class FirebasePushService implements PushService {
defaultTargetPlatform == TargetPlatform.iOS ? 'ios' : 'android';
Future<void> _ensureFirebase() async {
// No options passed: the native google-services.json / GoogleService-Info
// .plist added during the one-time project setup provide them.
// Options come from the committed firebase_options.dart rather than native
// config files, so no google-services.json / GoogleService-Info.plist is
// needed in the build.
if (Firebase.apps.isEmpty) {
await Firebase.initializeApp();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
}
}