Mark notification messages as read #695

Open
by foosinn opened 5 years ago · 27 comments
foosinn commented 5 years ago (Migrated from github.com)
Owner

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

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
Collaborator

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).

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).
foosinn commented 5 years ago (Migrated from github.com)
Poster
Owner

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?

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?
gappleto97 commented 5 years ago (Migrated from github.com)
Owner

For me they do not even get dismissed from the notifications menu on the phone

For me they do not even get dismissed from the notifications menu on the phone
Collaborator

@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.

@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.
foosinn commented 5 years ago (Migrated from github.com)
Poster
Owner

@IzzySoft may it sould be implemented as a new action "mark read"?

It would also be great if wie could assing either "mark read" or "dismiss" to long-press middle button.

@IzzySoft may it sould be implemented as a new action "mark read"? It would also be great if wie could assing either "mark read" or "dismiss" to long-press middle button.
Collaborator

@foosinn both nice ideas (though to be useful to me personally, I must be able to define that per app). I'm only an enthusiast user of GB, the decision on this must be left to the team 😸

@foosinn both nice ideas (though to be useful to me personally, I must be able to define that per app). I'm only an enthusiast user of GB, the decision on this must be left to the team :smile_cat:
Owner

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.

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.
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

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

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
foosinn commented 4 years ago (Migrated from github.com)
Poster
Owner

@lazarosfs thanks for looking into it. I am able to do this with the Pebble app and Andorid 7.1.1. Maybe there is a way?

I have installed Lineageos with Nanomod (no login to Google, no Android Wear)

@lazarosfs thanks for looking into it. I am able to do this with the Pebble app and Andorid 7.1.1. Maybe there is a way? I have installed Lineageos with Nanomod (no login to Google, no Android Wear)
Owner

I am pretty sure it is possible for apps having a notificationlistener service (like we do)

I am pretty sure it is possible for apps having a notificationlistener service (like we do)
gappleto97 commented 4 years ago (Migrated from github.com)
Owner

Its definitely possible. The Pebble app does it. The Android Wear app does it.

Its definitely possible. The Pebble app does it. The Android Wear app does it.
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

I have tried different approaches only thing I managed was to clear my own notifications.
Read herehttps://stackoverflow.com/questions/2665634/how-to-clear-a-notification-in-android
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

I have tried different approaches only thing I managed was to clear my own notifications. Read here[https://stackoverflow.com/questions/2665634/how-to-clear-a-notification-in-android](url) 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
gappleto97 commented 4 years ago (Migrated from github.com)
Owner

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.

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.
Owner

Let's not make confusion.

We are dismissing notifications since forever, the issue is about marking messages as read in the emitting application.

Let's not make confusion. We are dismissing notifications since forever, the issue is about marking messages as read in the emitting application.
gappleto97 commented 4 years ago (Migrated from github.com)
Owner

But its never dismissed a notification for me ever

But its never dismissed a notification for me ever
Owner

@gappleto97 then you are experiencing a bug and I kindly ask you to open a separate issue, providing all the information requested in the template.

@gappleto97 then you are experiencing a bug and I kindly ask you to open a separate issue, providing all the information requested in the template.
Owner

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)
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)
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

I would like clear and mark notifications for mi band 2. Maybe it should move to general section

I would like clear and mark notifications for mi band 2. Maybe it should move to general section
Owner

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!

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!
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

I did try the pebble code but in my miui marshmallow it only clears gadgetbridge notifications.

I did try the pebble code but in my miui marshmallow it only clears gadgetbridge notifications.
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

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).

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).
Owner

@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

@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]( https://github.com/Freeyourgadget/Gadgetbridge/blob/master/README.md#features-pebble). The dismissal is a normal GBDeviceEvent. See for instance [this part of the code](https://github.com/Freeyourgadget/Gadgetbridge/blob/master/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java#L258)
lazarosfs commented 4 years ago (Migrated from github.com)
Owner

Not having pebble made it a bit difficult to clear this but thanks.
Same option then for miband2 implemented.

Not having pebble made it a bit difficult to clear this but thanks. Same option then for miband2 implemented.
KazWolfe commented 4 years ago (Migrated from github.com)
Owner

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?

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?
Owner

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.

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.
KazWolfe commented 4 years ago (Migrated from github.com)
Owner

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.

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.
foosinn commented 4 years ago (Migrated from github.com)
Poster
Owner

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.

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.
vanous added the
notifications
label 1 year ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.