docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ICloudCodeService

    Client SDK for Cloud Code. https://dashboard.unity3d.com/cloud-code

    Streamline your game code in the cloud. Cloud Code shifts your game logic away from your servers, interacting seamlessly with backend services.

    Namespace: Unity.Services.CloudCode
    Assembly: Unity.Services.CloudCode.dll
    Syntax
    public interface ICloudCodeService

    Methods

    CallEndpointAsync(string, Dictionary<string, object>)

    Calls a Cloud Code function.

    Declaration
    Task<string> CallEndpointAsync(string function, Dictionary<string, object> args = null)
    Parameters
    Type Name Description
    string function

    Cloud Code function to call

    Dictionary<string, object> args

    Arguments for the cloud code function. Will be serialized to JSON.

    Returns
    Type Description
    Task<string>

    String representation of the return value of the called function. Intended to enable custom serializers.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    CloudCodeRateLimitedException

    Thrown if the service returned rate limited error.

    CallEndpointAsync<TResult>(string, Dictionary<string, object>)

    Calls a Cloud Code function.

    Declaration
    Task<TResult> CallEndpointAsync<TResult>(string function, Dictionary<string, object> args = null)
    Parameters
    Type Name Description
    string function

    Cloud Code function to call.

    Dictionary<string, object> args

    Arguments for the cloud code function. Will be serialized to JSON.

    Returns
    Type Description
    Task<TResult>

    Serialized output from the called function.

    Type Parameters
    Name Description
    TResult

    Serialized from JSON returned by Cloud Code.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    CloudCodeRateLimitedException

    Thrown if the service returned rate limited error.

    CallModuleEndpointAsync(string, string, Dictionary<string, object>)

    Calls a Cloud Code function.

    Declaration
    Task<string> CallModuleEndpointAsync(string module, string function, Dictionary<string, object> args = null)
    Parameters
    Type Name Description
    string module

    Cloud Code Module to call

    string function

    Cloud Code function to call.

    Dictionary<string, object> args

    Arguments for the cloud code function. Will be serialized to JSON.

    Returns
    Type Description
    Task<string>

    String representation of the return value of the called function. Intended to enable custom serializers.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    CloudCodeRateLimitedException

    Thrown if the service returned rate limited error.

    CallModuleEndpointAsync<TResult>(string, string, Dictionary<string, object>)

    Calls a Cloud Code function.

    Declaration
    Task<TResult> CallModuleEndpointAsync<TResult>(string module, string function, Dictionary<string, object> args = null)
    Parameters
    Type Name Description
    string module

    Cloud Code Module to call

    string function

    Cloud Code function to call.

    Dictionary<string, object> args

    Arguments for the cloud code function. Will be serialized to JSON.

    Returns
    Type Description
    Task<TResult>

    Serialized output from the called function.

    Type Parameters
    Name Description
    TResult

    Serialized from JSON returned by Cloud Code.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    CloudCodeRateLimitedException

    Thrown if the service returned rate limited error.

    SubscribeToPlayerMessagesAsync(SubscriptionEventCallbacks)

    Subscribe to push messages from the Cloud Code service for the currently logged in player.

    Declaration
    Task<ISubscriptionEvents> SubscribeToPlayerMessagesAsync(SubscriptionEventCallbacks callbacks)
    Parameters
    Type Name Description
    SubscriptionEventCallbacks callbacks

    The event callbacks to be invoked when messages are received from Cloud Code

    Returns
    Type Description
    Task<ISubscriptionEvents>

    SubscriptionEvents object that can be used to unsubscribe from messages.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    SubscribeToProjectMessagesAsync(SubscriptionEventCallbacks)

    Subscribe to push messages from the Cloud Code service for all project-wide messages.

    Declaration
    Task<ISubscriptionEvents> SubscribeToProjectMessagesAsync(SubscriptionEventCallbacks callbacks)
    Parameters
    Type Name Description
    SubscriptionEventCallbacks callbacks

    The event callbacks to be invoked when messages are received from Cloud Code

    Returns
    Type Description
    Task<ISubscriptionEvents>

    SubscriptionEvents object that can be used to unsubscribe from messages.

    Exceptions
    Type Condition
    CloudCodeException

    Thrown if request is unsuccessful.

    In This Article
    Back to top
    Copyright © 2025 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)