dattas / pebble-notifier

Pebble notifier for Android
MIT License
62 stars 31 forks source link

AquaMail sends false notifications to pebble #45

Open J0nnyMak0 opened 10 years ago

J0nnyMak0 commented 10 years ago

Hi, I have an IMAP IDLE account setup in AquaMail. Lets say I get 5 new emails, I get the notifications and everything is good. Until I start reading my messages in another email client (say on the web or my computer). After I open the first message, say in my email client on the computer, I get a notification saying: "4 new messages in xxxx@xxxx.com: Inbox". Then I open another one and yet another notification saying: "4 new messages in xxxx@xxxx.com: Inbox" and so forth.

I posted this to AquaMail's forums and the developer (Kostya) responded saying:

"Snooping on another app's notifications and trying to "guesstimate" an unread count from them is wrong. Maybe close, maybe works in some case, but in the end, it's wrong.

I'd be happy to talk to the developer of your Pebble integration app, and explain how to get the accurate unread count from Aqua (same value as shows on the icon for Apex / Nova / Samsung / Sony / now LG)."

Could someone from Pebble Notifier team please look into this.

Here is the link to the AquaMail forum thread. http://www.aqua-mail.com/forum/index.php?topic=2475.0 I will also update the thread with a link to this issue if Kostya wants to comment.

thanks!

dattas commented 10 years ago

There is no guesstimation. It simply reads the notification that their applications send out. They must be sending that notification out for it to show up on your pebble through pebble notifier.

J0nnyMak0 commented 10 years ago

Thanks for the quick reply. I've updated the Aquamail forum thread with your reply. Hopefully Kostya will comment. If not could you please let him know?

http://www.aqua-mail.com/forum/index.php?action=emailuser;sa=email;msg=10152

thanks!

kmansoft commented 10 years ago

@dattas I'm the developer of AquaMail.

There is no such thing as "the" notification -- in my app, people usually use one notification per account (so they'd have to be added together, etc.)

In addition, there may be legitimate cases when my code needs to update an existing notification because the information changed after a mail sync (e.g. there were 4 new messages, now there are 3, as one was marked read elsewhere, like web mail etc).

Finally, there are ongoing notifications, and unless you are able to check Notification.FLAG_ONGOING_EVENT and ignore those, they can throw things off too.

Now...

AquaMail has two APIs that could let our apps work better together.

First:

It posts the actual unread count via Apex Launcher - compatible broadcasts. This is a single value, total unread for all accounts. Right now my code sends it only when it detects specific apps that support this broadcast. If you'd like your app to be added, just let me know.

This is the Apex broadcast API:

http://forum.xda-developers.com/showthread.php?t=1930365

Second:

There is a more elaborate API using my own broadcast intents, the advantage is that you can find out which account triggered them, and also get the list of accounts via a ContentProvider. This way the user can configure Pebble notifications only for specific account(s).

If you're interested in either integration mechanism, please let me know by commenting here or emailing to kmansoft / gmail.