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

Option for using persistent notifications #107

Merged
merged 4 commits into from
Nov 20, 2023
Merged

Option for using persistent notifications #107

merged 4 commits into from
Nov 20, 2023

Conversation

AdrasteonDev
Copy link
Contributor

Description

First of all, thank you for creating One Second Diary ! I use it almost every day and I really like its concept.

The goal of the PR is to add an option for using persistent notifications (see the related issue).

I've added the "usePersistentNotifications" key to the English and French translation files. I don't know how to translate it into other languages. You may need to add a commit to add this key to the other translation files.

I had to add code to close the persistent notification and reschedule it when a daily entry is added, as the persistent notification cannot be cancelled by the user. I moved some methods from SwitchNotificationsComponent to NotificationService for this purpose.

For information I initially wanted to reschedule notifications to the next day when an entry is added, to make this case not possible:

  • A user schedules a persistent notification at 3 p.m.
  • The user records a video at 2pm
  • He receives the persistent notification at 3pm even though he has already recorded a video

I wasn't able to prevent this to happen, as the flutter_local_notification package doesn't allow to specify an initial date for "time" notifications. However, I managed to close the notification when the user opens the application if a video has already been recorded for the current day.

Checklist

Before you create this PR, please confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I have added a description of the change in CHANGELOG.md.
  • I have added my name in the CONTRIBUTORS.md file, if it wasn't already present.

@KyleKun
Copy link
Owner

KyleKun commented Nov 20, 2023

LGTM!

Thanks very much for your contribution!!

I don't know how to translate it into other languages. You may need to add a commit to add this key to the other translation files.

No worries, I'll do it. I've been using ChatGPT for that 😅.

@KyleKun KyleKun merged commit eb8afa4 into KyleKun:main Nov 20, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants