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

More advanced notification options #4006

Closed
ghost opened this issue Dec 17, 2015 · 4 comments
Closed

More advanced notification options #4006

ghost opened this issue Dec 17, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 17, 2015

New feature where the decks or subdecks that one chooses to make "Must-learn-daily" can be each set to notify at a particular time-of-day with its corresponding number of review cards. (instead of total review cards of all decks being notified that day)

This helps one to be prompted to review a particular deck at a particular time (morning or evening...)

@ghost ghost changed the title Priority deck and time-of-the-day setting of notifications Notification of chosen decks at chosen time-of-day Dec 18, 2015
@ghost ghost changed the title Notification of chosen decks at chosen time-of-day Notification from only chosen decks at chosen time-of-day Dec 19, 2015
@hssm hssm changed the title Notification from only chosen decks at chosen time-of-day More advanced notification options Dec 21, 2015
@madhead
Copy link
Contributor

madhead commented Oct 2, 2016

I was about to implement it. The logic is:

  1. Introduce new fields in deck configuration JSON, like:
    "12345": {
        "name": "12345",
        "new": {
            ...
        },
        "lapse": {
            ...
        },
        "rev": {
            ...
        },
        
        "reminder": {
            "enabled": true,
            "time": "10:10"
        },
        
        "maxTaken": 60,
        "timer": 0,
        "autoplay": true,
        "replayq": true,
        "mod": 1475020972,
        "usn": -1,
        "id": 12345,
        "dyn": 0
    }
    
  2. Set / remove Alarms via AlarmManager according to these values on each change.
    • Recreate the alarms using the values from the configuration on each reboot.
    • Remove the alarm when any deck is removed.
  3. Listen for the alarms.
  4. On receiving the alarm's broadcast, start a service that checks if there are any new cards in the specified deck and create a notification accordingly.
  5. Add a clause in IntentHandle to be able to "jump" to any deck when receiving the notification's PendingIntent.

The only problem is that I am not sure if it's ok to introduce new fields in the configuration JSON. When users will get this feature (if they get it at all) there will be no reminder in their decks. There will be no reminder in imported decks. This is solvable using a few ifs. But what will happen when interacting with the world (exporting any deck to other platform, syncing)?.

Any ideas? You can take a look at some code here.

@hssm
Copy link
Member

hssm commented Oct 3, 2016

AnkiDroid has a separate small configuration database in the MetaDB.java class. Have a look at that and see if it makes more sense to put it in there. For example, you can see how we're targeting individual decks for saving the preferred TTS language.

The downsides are:
1 - You can't sync the settings
2 - It's a lot more cumbersome

There is actually nothing technically wrong with putting the configuration inside the collection itself. A lot of add-ons on the desktop client already insert their own settings into the collection. As long as we take care not to corrupt it, the other clients can simply ignore the extra values.

@timrae
Copy link
Member

timrae commented Feb 2, 2017

The release of this will be delayed until v2.9 due to some issues

@ghost
Copy link
Author

ghost commented Oct 24, 2017

I badly need ankidroid to show cards directly by push notifications (like knudge.me app) set for desirable number of cards from desirable decks at desirable intervals of time in a day.
I find it stressful to review all cards continuously but feel guilty to take breaks voluntarily. It's my highest priority cause for procrastination. Please see to this feature to be highest priority too.

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

3 participants