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

Use BackgroundFetch and LocalNotifications to notify of new chapters #18

Open
agilgur5 opened this issue Oct 25, 2019 · 1 comment
Open
Labels
feature New feature or request

Comments

@agilgur5
Copy link
Owner

agilgur5 commented Oct 25, 2019

There's no server component to this, so we can't do this server-side and send a push notification, have to do it client-side and send local notification. Of course the major downside to this (apart from battery and phone usage) is that if the app is terminated or the phone is restarted, the BackgroundFetch won't start until the app is opened again 😕 On Android, there is a workaround built-in for both these cases, but not for iOS.

Sending Local Notif is easy enough, but BackgroundFetch requires some more reading and a bit of effort to get familiar and set-up.

Related to this would be loading chapters on the front-page / main view and highlighting mangas which have new unread chapters. New Unread Chapter indicates highlight in-app and LocalNotification out-of-app (probably no need to notify if app is still open, user will probably see the new chapter indicator themselves... well not if they quit the app while inside a manga... idk).

@agilgur5 agilgur5 added the feature New feature or request label Oct 25, 2019
@agilgur5
Copy link
Owner Author

agilgur5 commented Oct 29, 2019

So loading chapters in the main view and highlighting mangas with new unread chapters should definitely be in 1.0.0. I find myself using other apps without this feature as otherwise I have to click into each manga to tell if there's an update (or otherwise remember, and I don't even remember what time of week each releases, esp those that aren't weekly).

This should be fairly easy to implement, just call loadChapters on each favorited manga, and then, UI-wise, highlight those with new unread and write how many new unread under the title (probably instead of "Today"/"Yesterday" last updated? though those could be more useful if not caught up? or not... need to think about that a bit more).

The implementation details also made me realize that there's a small issue with local notifs, in that it has to know if it's already notified or not (i.e. don't notify there's a new chapter all day/week for the same manga). In practice, should be able to check if the number of chapters (chapters.length) differs from last time/the persisted number. Might want to check only latest though, as sometimes a sub-chapter like a 0.5 is added some chapters ago and that may or may not be worth notifying about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant