-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add
- Loading branch information
Showing
5 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/lib/core/provider/firebase/firebase_messaging_interaction.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:eqmonitor/core/provider/firebase/firebase_messaging.dart'; | ||
import 'package:firebase_messaging/firebase_messaging.dart'; | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
part 'firebase_messaging_interaction.g.dart'; | ||
|
||
@Riverpod(keepAlive: true) | ||
Stream<RemoteMessage> firebaseMessagingInteraction( | ||
FirebaseMessagingInteractionRef ref, | ||
) async* { | ||
final messaging = ref.watch(firebaseMessagingProvider); | ||
final initialMessage = await messaging.getInitialMessage(); | ||
if (initialMessage != null) { | ||
yield initialMessage; | ||
} | ||
|
||
yield* FirebaseMessaging.onMessageOpenedApp; | ||
} |
29 changes: 29 additions & 0 deletions
29
app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...fication_remote_settings/data/service/notification_remote_settings_migrate_service.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.