WeChat friend circle that Little red dot how to achieve?

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.