search

Home  >  Q&A  >  body text

android - 微信的@功能如何实现的?

请问微信的@功能大致如何实现呢?消息接收方如何判断自己被@了呢?

怪我咯怪我咯2772 days ago481

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:06:20

    Refer to push, this is what the server does. The client only needs to receive it

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 09:06:20

    Monitor the input box. If @ is added, it will trigger the selection of the person. After the selection is completed, there will be a field in the message specifically to store the information of the person being @. It is worth noting that the number of "@" characters in the message content must be the same as the number in the field. The number of characters remains the same. Even if it is not the ordinary @ character of @ person, the information of a special empty person must be added to facilitate the server's judgment. There are still some details to deal with. The general idea is this.

    If you want to receive it, you just need to see if there is yourself in that field. If it is, it means @himself

    reply
    0
  • Cancelreply