Show / Hide Table of Contents

    Class CloudServices

    Provides a cross-platform interface to sync information across various devices by storing it in the cloud.

    Inheritance
    System.Object
    CloudServices
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ToString()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: VoxelBusters.EssentialKit
    Assembly: cs.temp.dll.dll
    Syntax
    public static class CloudServices
    Remarks

    \note

    On iOS, the total amount of space available to store key-value data, for a given user, is 1 MB. There is a per-key value size limit of 1 MB, and a maximum of 1024 keys. If you attempt to write data that exceeds these quotas, the write attempt fails and no change is made to your cloud. In this scenario, the system posts the OnSavedDataChange with a change reason of .

    Properties

    UnitySettings

    Declaration
    public static CloudServicesUnitySettings UnitySettings { get; }
    Property Value
    Type Description
    CloudServicesUnitySettings

    Methods

    GetBool(String)

    Returns the boolean value associated with the specified key.

    Declaration
    public static bool GetBool(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Boolean

    The boolean value associated with the specified key, that value is returned. or false if the key was not found.

    GetByteArray(String)

    Returns the array object associated with the specified key.

    Declaration
    public static byte[] GetByteArray(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Byte[]

    Array object associated with the specified key, or null if the key was not found or its value is not an Array object.

    GetDouble(String)

    Returns the double value associated with the specified key.

    Declaration
    public static double GetDouble(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Double

    The double value associated with the specified key or 0 if the key was not found.

    GetFloat(String)

    Returns the float value associated with the specified key.

    Declaration
    public static float GetFloat(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Single

    The float value associated with the specified key or 0 if the key was not found.

    GetInt(String)

    Returns the integer value associated with the specified key.

    Declaration
    public static int GetInt(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Int32

    The integer value associated with the specified key, that value is returned. or false if the key was not found.

    GetLong(String)

    Returns the long value associated with the specified key.

    Declaration
    public static long GetLong(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.Int64

    The long value associated with the specified key or 0 if the key was not found.

    GetString(String)

    Returns the string value associated with the specified key.

    Declaration
    public static string GetString(string key)
    Parameters
    Type Name Description
    System.String key

    A string used to identify the value stored in the cloud data store.

    Returns
    Type Description
    System.String

    The string associated with the specified key, or null if the key was not found or its value is not an string object.

    IsAvailable()

    Declaration
    public static bool IsAvailable()
    Returns
    Type Description
    System.Boolean

    RemoveKey(String)

    Removes the value associated with the specified key from the cloud data store.

    Declaration
    public static void RemoveKey(string key)
    Parameters
    Type Name Description
    System.String key

    The key corresponding to the value you want to remove.

    SetBool(String, Boolean)

    Sets a boolean value for the specified key in the cloud data store.

    Declaration
    public static void SetBool(string key, bool value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Boolean value

    The boolean value to store.

    SetByteArray(String, Byte[])

    Sets an array object for the specified key in the cloud data store.

    Declaration
    public static void SetByteArray(string key, byte[] value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Byte[] value

    Array object whose contents has to be stored. The objects in the list must be primitive, IList, IDictionary.

    SetDouble(String, Double)

    Sets a double value for the specified key in the cloud data store.

    Declaration
    public static void SetDouble(string key, double value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Double value

    The double value to store.

    SetFloat(String, Single)

    Sets a float value for the specified key in the cloud data store.

    Declaration
    public static void SetFloat(string key, float value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Single value

    The float value to store.

    SetInt(String, Int32)

    Sets a interger value for the specified key in the cloud data store.

    Declaration
    public static void SetInt(string key, int value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Int32 value

    The integer value to store.

    SetLong(String, Int64)

    Sets a long value for the specified key in the cloud data store.

    Declaration
    public static void SetLong(string key, long value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.Int64 value

    The long value to store.

    SetString(String, String)

    Sets a string value for the specified key in the cloud data store.

    Declaration
    public static void SetString(string key, string value)
    Parameters
    Type Name Description
    System.String key

    The key under which to store the value. The length of this key must not exceed 64 bytes.

    System.String value

    The string value to store.

    Synchronize(Callback<CloudServicesSynchronizeResult>)

    Explicitly synchronizes in-memory data with those stored on disk.

    Declaration
    public static void Synchronize(Callback<CloudServicesSynchronizeResult> callback = null)
    Parameters
    Type Name Description
    Callback<CloudServicesSynchronizeResult> callback
    Remarks

    \note OnSynchronizeComplete is triggered, when your app has completed processing synchronisation request.

    Events

    OnSavedDataChange

    Event that will be called when the value of one or more keys in the local key-value store changed due to incoming data pushed from cloud.

    Declaration
    public static event Callback<CloudServicesSavedDataChangeResult> OnSavedDataChange
    Event Type
    Type Description
    Callback<CloudServicesSavedDataChangeResult>

    OnSynchronizeComplete

    Event that will be called when the synchronize request is finished.

    Declaration
    public static event Callback<CloudServicesSynchronizeResult> OnSynchronizeComplete
    Event Type
    Type Description
    Callback<CloudServicesSynchronizeResult>

    OnUserChange

    Event that will be called when cloud user changed.

    Declaration
    public static event EventCallback<CloudServicesUserChangeResult> OnUserChange
    Event Type
    Type Description
    EventCallback<CloudServicesUserChangeResult>
    Back to top Cross Platform Native Plugins 2.0 : Essential Kit from Voxel Busters