Removing a deleted notification from Action Center

Some apps, notably the StackExchange app and facebook, may remove notifications from Action Center / Lockscreen if you view the notification elsewhere. For example, if I get a notification of incoming messages from stack exchange and then look at my inbox on my laptop, the notification disappears from my phone almost immediately. I originally thought this was something Apple could do with Mail and Facebook.

How does StackExchange send a notification to the phone to delete an existing notification?

0


source to share


3 answers


I think they should send a notification with the icon number '0' to remove all existing ones from the notification center. I noticed the same behavior in the Gmail app, so I did a little research on it:

  • When I send one email, I get a push notification on my phone. Then I open this email from my laptop browser and immediately the action center is clear.

  • When I send two emails, I get two push notifications. Then when I open the first one on my laptop, both notifications stay on my iPhone . After I open the second email (still on my laptop), the action center is cleared.

I did some additional checks with Wireshark and I think that every time I open an email on my laptop, Google sends a push notification to my phone (even if there are still unread messages in my inbox).



In all of the above cases, the gmail app was not working (however, I'm not sure if the background fetch introduced on iOS 7 could complicate things).

I hope this helps!

+3


source


Based on @Irene's answer to my gmail-like suggestion for this:

As soon as it happens on the desktop or the Internet, i.e. you will read the mail. Google Server always calculates what is the badget / notification_number for a particular user. It's that simple: - if it is new mail or is marked as unread mail, increase it - if read, mark as read, archive or something like that decreases. (Google only cares about mails in the Inbox.)

So, every time this number changes, it sends a pushnotitfication for all sessions, updating the icon.

In the case of iOS, whenever you send badget = 0, it clears all notifications. So, most of the time, if you get organized, you will get a notification (there will only be one), and if you read it anywhere else, it will reject your iOS because you get badget = 1 and then badget = 0.



But as Irene said, if you have more than one unread mail. it will just decrease the icon number in your application. The gmail app icon will shrink from 10, 9, 8, 7 ... while you read emails. But the same rules apply. If you get badget = 0, it will remove all local notifications.

My guess is that this does the trick.

Hope it helps,

+1


source


with Push Notifications, we can send a parameter notification expiry

(at least the one that is supported in PHP language

), and maybe it's something that gets updated when the email is read on other devices.

// Set the expiry value to 86400 seconds - 1440 minutes
$message->setExpiry(86400); // This message will expire in N seconds

      

The same happens with Viber application

, it supports desktop and iOS app, if you have a new message, it sends you a notification and as you read on your computer, it also deletes the push message to the mobile. It should be with a parameter expire

according to my knowledge.

Please correct me if I am wrong.

0


source







All Articles