Skip to content

Commit

Permalink
chore: add default platform to all initializeapp calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-Zimmerman committed Feb 10, 2025
1 parent 3f2a64f commit 1fccc3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ class AppInitializer {

/// Firebase
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform);
options: DefaultFirebaseOptions.currentPlatform,
);
if (!kIsWeb && Platform.isAndroid) {
FirebaseMessaging.onBackgroundMessage(
_firebaseMessagingBackgroundHandler,
Expand Down Expand Up @@ -169,7 +170,9 @@ var fromBackground = false;
// Android Only - Push Notifications
@pragma('vm:entry-point')
Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
logger.i('Handling a background message ${message.toMap().toString()}');
await NotificationService.showNotification(message);
FlutterCallkitIncoming.onEvent.listen((CallEvent? event) async {
Expand Down

0 comments on commit 1fccc3a

Please sign in to comment.