Inside, if someone in the circle of friends sends a message.
There will be a little red dot in the circle of friends, not the little red dots of numbers.
How is this server-side change implemented?
Reply content:
Inside, if someone in the circle of friends sends a message.
There will be a little red dot in the circle of friends, not the little red dots of numbers.
How is this server-side change implemented?
First I assume that you already know how to get friends updated friend Circle data (after all you did not ask), only the logic to show the Little red dot, judge should not show the Little red dot only one factor: since the user last click on a friend circle, friends have updated data. Here can be broken down into two steps, one is to save the user last click on a friend Circle time, one is the user every time after launching the app, to determine whether the data of his friend circle after the user last click on the circle of friends has increased. You know what you're talking about here? Is it easier to disassemble these two steps?
PS. It is recommended to save the time of the last click of a friend to the database so that your data analyst can analyze user behavior.
Server with SSE
Android can be easily implemented using an open source library Badgeview on GitHub, address: Https://github.com/stefanjauker/BadgeView
On the TCP channel, a TCP connection is established with the server when the client starts (or the client starts the app service).
When a friend circle is updated, someone sends you a message and someone reviews your status while browsing a friend's circle. These scenarios are data pushed over TCP.