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

Notification only shown when app is opened #4615

Closed
loewexy opened this issue Apr 4, 2017 · 17 comments
Closed

Notification only shown when app is opened #4615

loewexy opened this issue Apr 4, 2017 · 17 comments

Comments

@loewexy
Copy link

loewexy commented Apr 4, 2017

Research

Enter an [ x ] character to confirm the points below:

[x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[x] I have checked the manual and the FAQ and could not find a solution to my issue

[x] I have searched for similar existing issues here and on the user forum

Reproduction Steps
  1. Enable notifications on more than 10 due cards.
  2. Enter some Cards
  3. Wait until more than 10 cards are due.
Expected Result

A notification should be shown without opening the app.

Actual Result

I have to open the app, then a notification is shown. But this does not make sense as I can see the due cards in the allready opened app.

Debug info

AnkiDroid Version = 2.8.2
Android Version = 6.0.1
ACRA UUID = 78549792-7916-4041-a6b2-b58d85214139

@timrae
Copy link
Member

timrae commented Apr 5, 2017

See the manual

screenshot from 2017-04-05 09-21-19

@timrae timrae closed this as completed Apr 5, 2017
@timrae timrae reopened this Apr 5, 2017
@timrae
Copy link
Member

timrae commented Apr 5, 2017

Although we can probably remove this limitation without much work thanks to #4450

@loewexy
Copy link
Author

loewexy commented Apr 5, 2017

Ok yes this fixes the problem, it would be nice if it was possible without the widget. But in the meantime I just replaced the shortcut with the widget.

@Nutomic
Copy link
Contributor

Nutomic commented Apr 20, 2017

@timrae How would you implement this? It seems like BootService already has some code for this, calling ReminderService every day. I guess the easiest solution would be a permanent background service, that checks the number of due cards every hour or so. All the existing services could be merged into this single service.

@timrae
Copy link
Member

timrae commented Apr 20, 2017

@Nutomic
I haven't really been through @madhead's code in a lot of detail so I'm not sure how I would implement it. Is BootService already running permanently, or does it only run when it needs to? We have to be careful not to inadvertently reduce battery life of users that have not opted into reminders.

@madhead
Copy link
Contributor

madhead commented Apr 20, 2017

BootService is not running permanently. It is a one-shot service that runs just after device restart. It's purpose is to enable alarms for every deck that is configured for notifications. Also, you don't need to run service permanently to notify the user, I think alarms can do that, but they are reset after restarts, that's why you need a BootReceiver and BootService

@moshpirit
Copy link

I'm using KISS launcher, which doesn't allow to use widgets (to keep it simple). How long do you think it would take to implement this feature?

Thanks a lot for this great app!!

@damccull
Copy link

I would like to suggest not running a service permanently. Android offers something called an alarm. You can set an alarm when you first run the app that will be maintained by the system itself. When the alarm is up, it can call an intent to start the service, which should then check the cards due, notify if required an then set another alarm and shut itself down. You can also set the service to auto start on system boot, I believe, to accomplish this the first time after a boot.

This approach gives you the same effect you want without leaving the application running constantly in the background as a service. It saves battery, cpu, and ram, and will keep the app from being killed by those ridiculous memory manager apps everyone's always downloading.

Please tag me reply if you need any further info from me.

@damccull
Copy link

Yeah @madhead already seems to have set that up...so can we get notified without the widget please? 😁

@timrae
Copy link
Member

timrae commented Aug 12, 2017 via email

@madhead
Copy link
Contributor

madhead commented Aug 12, 2017

I remember that we pulled out the code for this feature out of master because of some non-reproducible bugs on some devices.

@timrae
Copy link
Member

timrae commented Aug 12, 2017 via email

@damccull
Copy link

damccull commented Aug 12, 2017 via email

@damccull
Copy link

damccull commented Aug 12, 2017 via email

@timrae
Copy link
Member

timrae commented Aug 12, 2017

@madhead's code is in master, refer to the PR for the code and unresolved issues:
#4450

That PR doesn't address the specific issue in this thread though, as those notifications are separate from the notifications based on how many cards are due that are currently tied to the widget.

@damccull
Copy link

damccull commented Aug 12, 2017 via email

@timrae
Copy link
Member

timrae commented Aug 12, 2017

Thanks, I'm sure a lot of people would appreciate it if you do end up getting the time to do that!

Nutomic added a commit to Nutomic/Anki-Android that referenced this issue Sep 5, 2017
Nutomic added a commit to Nutomic/Anki-Android that referenced this issue Sep 5, 2017
Nutomic added a commit to Nutomic/Anki-Android that referenced this issue Sep 13, 2017
@timrae timrae closed this as completed in 711e41f Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants