docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FriendsPresenceApi

    Represents a collection of functions to interact with the API endpoints

    Inheritance
    object
    FriendsPresenceApi
    Implements
    IFriendsPresenceApi
    IApiAccessor
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Services.Apis.Friends
    Assembly: solution.dll
    Syntax
    public class FriendsPresenceApi : IFriendsPresenceApi, IApiAccessor

    Constructors

    FriendsPresenceApi(IApiClient)

    Initializes a new instance of the FriendsPresenceApi class using a Configuration object and client instance.

    Declaration
    public FriendsPresenceApi(IApiClient apiClient)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    FriendsPresenceApi(IApiClient, IApiConfiguration)

    Initializes a new instance of the FriendsPresenceApi class using a Configuration object and client instance.

    Declaration
    public FriendsPresenceApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    IApiConfiguration apiConfiguration

    The configuration object.

    Properties

    Client

    The client for accessing this underlying API asynchronously.

    Declaration
    public IApiClient Client { get; }
    Property Value
    Type Description
    IApiClient

    Configuration

    Gets the configuration object

    Declaration
    public IApiConfiguration Configuration { get; }
    Property Value
    Type Description
    IApiConfiguration

    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

    GetPresence(string, CancellationToken)

    Get presence for a user. Retrieves the presence data for a specific user. If the caller is a user, then the target user must be one that the caller has an active FRIEND relationship with.

    Declaration
    public ApiOperation<UserPresence> GetPresence(string userId, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string userId

    The userID.

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<UserPresence>

    The operation

    SetPresence(PresenceRequest, CancellationToken)

    Set presence for a user. Updates the presence data for a user. This can be either or both of the availability and the activity. Updates to the presence for a user will be pushed to all users with active FRIEND relationships with that user.

    Declaration
    public ApiOperation<UserPresence> SetPresence(PresenceRequest presenceRequest = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    PresenceRequest presenceRequest

    (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<UserPresence>

    The operation

    Implements

    IFriendsPresenceApi
    IApiAccessor
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)