Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push notification helper #73

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
push_notifications
filip-ams committed Jan 24, 2025
commit 98a9af5dfb37d6ee8b3b6b830926f733f3a3b808
30 changes: 0 additions & 30 deletions example/SampleProject/test/widget_test.dart

This file was deleted.

3 changes: 2 additions & 1 deletion lib/firebase_api.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:firebase_messaging/firebase_messaging.dart';

// You can configure the firebase push notifications with flutterfire (https://firebase.flutter.dev/docs/overview)

Future<void> handleBackgroundMessage(RemoteMessage message) async {
print("Title: ${message.notification?.title}");
print("Body: ${message.notification?.body}");
@@ -12,7 +14,6 @@ Future<void> handleForegroundMessage(RemoteMessage message) async {
print("Payload: ${message.data}");
}


class FirebaseApi{

final _firebaseMessaging = FirebaseMessaging.instance;
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ dependencies:
path_provider_macos: ^2.0.7
flutter_background: ^1.2.0
firebase_core: ^3.10.1
firebase_messaging: ^15.1.6

dev_dependencies:
flutter_test: