I have a Flutter Web application. In it, I use push notifications. The start screen is the login screen. I have two scenarios:
-
First launch of the application:
When the user clicks “login”, I request permission to receive push notifications – a dialog appears, and I register handlers for notifications.NotificationSettings result = await FirebaseMessaging.instance.requestPermission();
Currently, everything works fine.
- Reloading the page in the browser:
However, when I reload the page in the browser, it doesn’t work.
Although the login page opens after reloading, and I click “login”.
The same code as in “scenario 1” is executed when clicking. The only difference is that the “permission dialog” does not appear, but that makes sense since I have already granted permission. However, in this case, push notifications do not work.
what could be the reason? how to fix it?