Class FriendsMessagingApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Friends
Assembly: Unity.Services.Apis.dll
Syntax
public class FriendsMessagingApi : IFriendsMessagingApi, IApiAccessor
Constructors
FriendsMessagingApi(IApiClient)
Initializes a new instance of the Friends
Declaration
public FriendsMessagingApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
FriendsMessagingApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Friends
Declaration
public FriendsMessagingApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
IApi |
apiConfiguration | The configuration object. |
Properties
Client
The client for accessing this underlying API asynchronously.
Declaration
public IApiClient Client { get; }
Property Value
Type | Description |
---|---|
IApi |
Configuration
Gets the configuration object
Declaration
public IApiConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
IApi |
An instance of the Configuration |
Methods
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
Message(MessageRequest, CancellationToken)
Send a message to a user. Allows a user to send a message with a custom payload to another user. The Relationships Service will only allow a user to send a message to a user that they have an active FRIEND relationship with. The content of the payload can be customized entirely by the client. It is up to the client to determine how to best handle the message payload. For example, if the message payload contains a lobby ID, the client could show an Accept Invite toast. If the message contains a trade request, the client could enter a trading interface.
Declaration
public ApiOperation Message(MessageRequest messageRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Message |
messageRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |