Added automatic refreshing of Notification token

This commit is contained in:
MineTec committed 2023-08-20 22:34:28 +02:00
1 parent c1c2c06873
commit 06e665ce2e
1 file changed
+3 -1
+3 -1
View File
@@ -47,7 +47,9 @@ class _AppState extends State<App> {
});
if(Provider.of<SettingsProvider>(context, listen: false).val().notificationSettings.enabled) {
NotifyUpdater.registerToServer();
FirebaseMessaging.instance.onTokenRefresh.listen((event) {
NotifyUpdater.registerToServer();
});
}
FirebaseMessaging.onMessage.listen((message) => NotificationController.onForegroundMessageHandler(message, context));