Documentation

PresenceApi

Import

Import

  • const { PresenceApi } = require("@unity-services/friends-1.0");

Constructors

Constructor

  • Parameters

    • Optional configuration: Configuration
    • basePath: string = ...
    • axios: AxiosInstance = ...

    Returns PresenceApi

Methods

Get Presence

  • getPresence(userId: string, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<UserPresence, any>>
  • 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.

    summary

    Get presence for a user.

    throws

    {RequiredError}

    memberof

    PresenceApi

    Parameters

    • userId: string

      The userID.

    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<UserPresence, any>>

Set Presence

  • 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.

    summary

    Set presence for a user.

    throws

    {RequiredError}

    memberof

    PresenceApi

    Parameters

    • Optional presenceRequest: PresenceRequest
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<UserPresence, any>>