mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Opus 4.8
parent
d81eba3b37
commit
44ec383744
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user