Documentation

​
​

Development

User Acquisition

Monetization

Industry

Friends

Friends

Multiplayer
​
​
Friends
  • Overview
  • Get started
  • Concepts
  • Tutorials
  • Reference
  • Privacy and consent

Welcome to Friends

Explore the Friends service for managing player relationships and connections.
Read time 2 minutes
Last updated 8 months ago

The Friends service allows you to boost player engagement by providing players with a social system that works well with other Unity services. With Friends, your players can:
  • Send and receive friend requests.
  • Build and manage friend lists.
  • Block and unblock other players.
  • The user sends a message to a friend.
Environments are logical partitions of Unity Game Services that contain data associated with your project. You can set the target environment in the Unity Dashboard and your initialization scripts.
The Friends API uses JSON Web Token (JWT) authentication. The Authentication SDK supports Anonymous authentication and Platform-specific authentication.

Understanding Friends

The Friends service manages relationships of different types. In general, most user relationships don’t change often; however, there are updates users often want to know about as soon as possible. To increase efficiency, the Friends SDK fetches all a user’s relationships one time at startup, then keeps the list up-to-date using push notifications.
The SDK sends change notifications as soon as the changes occur. User relationship changes that trigger a push notification include:
  • A friend updates their presence status.
  • Updates to the presence state for an individual user.
  • The user adds a new relationship. A user creates a
    FRIEND_REQUEST
    relationship
    .
  • The user removes a relationship, or a
    FRIEND
    relationship
    is otherwise deleted.
The Friends service treats all relationships the same. You can use the various properties of each relationship to decide how to treat that relationship. Each relationship has one or more members (players), each of which might have extra properties that identify that member’s role in the relationship. For example, a
FRIEND_REQUEST
relationship always has two members:
  1. A member with a
    SOURCE
    role (the sender).
  2. A member with a
    TARGET
    role (the receiver).
However, the member's role changes to
NONE
when a
FRIEND_REQUEST
relationship changes to a
FRIEND
relationship.
The SDK provides some wrapper APIs for specific operations to increase the service’s usability.
For example, when you call the
SendFriendRequestAsync
method, it calls the
CreateRelationship
API and creates a new
FRIEND_REQUEST
relationship with the target user.
If there’s already a
FRIEND_REQUEST
relationship from the target user, it creates a new
FRIEND
relationship. Depending on the state,
SendFriendRequestAsync
can result in a
FRIEND_REQUEST
or a new
FRIEND
relationship.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Understanding Friends


Report a problem with this page