The problem was caused because though the Notification permission was requested, the case was not handled where the user denied the notification permission.
Solution proposed
The following changes are made to improve the user experience and code quality
The app no longer requests notification permission on startup
In the NotificationService class the functions _scheduleNotification and showNotification handle the notification call in which if the user has denied the notification permission only then the permission is asked and if allowed then the notification is sent.
The said functions also return a boolean value to indicate if the notification was launched or not, which can be used to handle the notification state.
Problem / Issue No.
201
Describe Problem / Root Cause
Solution proposed
The following changes are made to improve the user experience and code quality
_scheduleNotification
andshowNotification
handle the notification call in which if the user has denied the notification permission only then the permission is asked and if allowed then the notification is sent.Additional Information
Screenshots
https://github.com/andoriyaprashant/OpSo/assets/92669664/1d4adea7-473d-4e56-b092-6aaa35c58579
https://github.com/andoriyaprashant/OpSo/assets/92669664/1cc54a9a-17a5-4dec-81ff-dbc0c8f1a2a0