文档

​
​

Development

User Acquisition

Monetization

工业

Friends

Friends

Multiplayer
​
​
Friends
  • Overview
  • Get started
  • Concepts
    • Relationships
    • Friends
    • Friend list
    • Friend requests
    • Block list
    • Presence
    • Message
    • Profile
    • Events
  • Tutorials
  • Reference
  • Privacy and consent
  1. 欢迎使用 Friends(Beta 版)

Events

Understand the event system for tracking changes in the status and relationships of friends.
阅读时间1 分钟
最后更新于 9 个月前

Most relationships don’t change often, but when there are changes, users want to know about them as soon as possible. The Friends SDK fetches all a user's relationships at startup, then keeps the list up-to-date using events.
The SDK sends events as soon as changes occur. User relationship changes that trigger an event include:
  • A friend updates their presence status.
  • The user adds a new relationship. A user creates a
    FRIEND_REQUEST
    relationship or a
    FRIEND_REQUEST
    is accepted creating a
    FRIEND
    relationship.
  • The user removes a relationship like a
    FRIEND_REQUEST
    , a
    FRIEND
    , or a
    BLOCK
    relationship.
You can use callbacks that run in response to notification events to subscribe the current user to notifications.
You can subscribe (and unsubscribe) to the following event types:

Parameter

Description

RelationshipAddedEvent invoked when a relationship involving the current user gets added.
RelationshipDeletedEvent invoked when a relationship involving the current user gets deleted.
PresenceUpdatedEvent invoked when the presence of a member associated with the current user updates their presence.
MessageReceivedEvent invoked when a user sends a message to the current user.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。


    报告此页面的问题