Documentation

MessagingApi

Import

Import

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

Constructors

Constructor

Methods

Message

  • message(messageRequest?: MessageRequest, options?: AxiosRequestConfig<any>): Promise<AxiosResponse<void, any>>
  • 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.

    summary

    Send a message to a user.

    throws

    {RequiredError}

    memberof

    MessagingApi

    Parameters

    • Optional messageRequest: MessageRequest
    • Optional options: AxiosRequestConfig<any>

    Returns Promise<AxiosResponse<void, any>>