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

Fixed app crash when notification permission is denied, issue #201 #202

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

ShashankDeepak
Copy link
Contributor

Problem / Issue No.

Describe Problem / Root Cause

  • 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.

Additional Information

  • Relevant information regarding the solution.

Screenshots

  • Original Screenshot (Problem/Issue)
error.mp4
  • Updated Screenshot (Fixes/Solution)
solution.mp4

Copy link

Thank you for submitting your pull request! We'll review it as soon as possible.

@ShashankDeepak
Copy link
Contributor Author

I would be grateful if you could assign a level to the issue.

@andoriyaprashant andoriyaprashant merged commit e08f6ca into andoriyaprashant:main Jun 12, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants