Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Missing-Tech committed Jul 29, 2021
1 parent ec7be1b commit f0dfb6f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/utils/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';

import '../main.dart';

Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
print('received background notification');
}

class Notifications {
static Future<void> initializeNotifications() async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
Expand All @@ -18,13 +14,13 @@ class Notifications {
}

static Future<void> listenForNotification(BuildContext context) async {
FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler);

// Received a notification while app is in foreground
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
navigateToScreen(context, message);
showNotification(message);
});

// Opened a notification while app is in background
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async {
navigateToScreen(context, message);
});
Expand Down

0 comments on commit f0dfb6f

Please sign in to comment.