Mark notification messages as read
Dismissed notifications on the Pebble seems to not mark them as read in the conversation. The stock Pebble app seems to be able to do this. Also the long-press middle button to dismiss does not work.
I tested this with Whatsapp and K9.
Your wearable device is: Pebble Time Steel
Your android version is: 7.1.2 Linageos without GAPPS
Your Gadgetbridge version is: 0.19.2
Must be specific to your setup – works fine here with Pebble Time Steel, GB and K9 (cannot speak for WA, as I don't use that), just tried it out to verify. Difference here: not Lineage, but I'm still on CyanogenMod. No GApps either (I'm using microG).
did a quick retest. Still the notifications go away, but the messages are not marked as read.
I'm running firmware 4.3 on the pebble. I only have "enable untested features" enabled, nothing else.
I do not have microG. May that required?
For me they do not even get dismissed from the notifications menu on the phone
@foosinn Sorry, I obviously misunderstood you. Messages are not marked read here either, it's just the notification on the Android device that gets dismissed along. Not sure if "mark read" is implemented at all with GB.
I wasn't aware of the long-press-middle-button-to-dismiss feature, that one looks interesting to me. I will also take a look at the mark-read feature, as long as it's not app-specific I think it could be done.
Don't waste your time I tried to implement it.
Nougat does not allow of one app to dismiss notifications of another. Also for whatsapp and viber you have to acrually open the app to mark them as read
Its definitely possible. The Pebble app does it. The Android Wear app does it.
I have tried different approaches only thing I managed was to clear my own notifications.
I wanted to add an option to gb to auto clear notifications.
I dont know if it can be done through the accessibility manager permissions.
Either way I still believe that at best you will clear the notification but you wont be able to mark as read because you have to call the notifications intent and open the app to do that
If I remember right, Tasker can do this if you give it notification access in the accessibility settings. I think Pebble had a similar setup, but its been a while since I had that app.
Let's not make confusion.
We are dismissing notifications since forever, the issue is about marking messages as read in the emitting application.
But its never dismissed a notification for me ever
So my current understanding of the issue is:
- The "mark as read" functionality must be supported by the emitting application (read the news about Google's messenger having added this functionality only in DP3 of android O)
- if supported, an additional action is present in the notification
- we already dissect the notifications in order to find the "reply to" action, so it should be possible for us to detect the "Mark as read" action as well
- hopefully this is not app specific ("reply to" has an attached input that we use to recognize it as such)
My main question is ui-wise:
- should the "dismiss" action always mark the original message as read (if the app supports it)?
- should we add a setting to customize the behavior?
- should we add another action on the pebble to dismiss and mark as read? (Please note that I'm not sure if this is possible)
I would like clear and mark notifications for mi band 2. Maybe it should move to general section
You could check the dismissal in the pebble code for inspiration but yes, I'd say it's better to open a new issue if you intend to add support for dismissal with other devices!
I did try the pebble code but in my miui marshmallow it only clears gadgetbridge notifications.
I have solved this for mi band 2.
Basically it is a different option than the one implemented for the pebble.
The existing gb code dismisses notifications from the pebble when cleared from android while I wanted to implement clearing notifications from android if mi band 2 receives them.
I added an option on the Mi band settings and code to MiBand2Support and NotificationListener for that to happen. After lollipop you have to cancel notifications by supplying the key, and that is basically enough if you keep a list of notification keys and you can dismiss other app notifications without problem.
In my code I check if the mi band2 is connected and will be notified and after that I clear the notification from the phone if the option is enabled.
Sorry I don't have time to create branches and upload sources, if anyone is interested my sources are
link removed (it is not ok to copy or take the code unless the author adds it to the repository. This could expose the project to long term troubles related to IP rights).
@lazarosfs I'm sorry you didn't find the code I was referring to, but please hold on from spreading false information that could yield to long-term misunderstandings.
The pebble is able to dismiss android notifications on the (android) device, when the user chooses "dismiss" on the watch. This is correctly listed in the readme. The dismissal is a normal GBDeviceEvent. See for instance this part of the code
Not having pebble made it a bit difficult to clear this but thanks.
Same option then for miband2 implemented.
Can confirm long-press-to-dismiss exists on Pebble native (Pebble Time, FW v4.3), and that it will dismiss the notification from the Android device as well.
I am not aware of any mark-read mechanism through long-press on any app, and I haven't found a way to do it without it being a context item.
I'll look a bit into this and see if I can figure out how the Pebble app does this. Might take a while, the code is definitely pretty hard to work with at times.
I would have assumed that the hold-on-middle-button is a watch action that just sends a dismiss command to the client, but I guess not. This is going to be interesting, isn't it?
Mark read is available for me in signal and in conversations. Although I need to double check if the option is available when multiple "threads" are added to the same notification.
Personally, I'd say that we shouldn't add mark-read as an automatic thing (that is, if the app even supports it) on dismissal. I haven't seen the native Pebble app do that, and it's sort of a bad design practice as well.
For example, say I'm going for a run and I get a notification that I got some important email. I dismiss the notification on my watch (and thereby my phone). I'm aware that there's an e-mail, but I don't have time to read it right now. Instead whenever I get back to my computer, I'm going to open my email app and then find that unread e-mail.
By all means, show it as a context option when available (so when the app allows it), but we shouldn't do it for the user. Dismissing and marking read should be two separate actions.
Still looking at how long-press-to-dismiss is implemented, because it's honestly making no sense right now or last night.
It's on long press and in the context menu on the original Pebble app. If Gadgetbridge would mimic that behavior there wont be a change to the current default action.
Deleting a branch is permanent. It CANNOT be undone. Continue?