Essential Kit
Loading...
Searching...
No Matches
CloudServices

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

Static Public Member Functions

static bool GetBool (string key)
 Returns the boolean value associated with the specified key.
 
static int GetInt (string key)
 Returns the integer value associated with the specified key.
 
static long GetLong (string key)
 Returns the long value associated with the specified key.
 
static float GetFloat (string key)
 Returns the float value associated with the specified key.
 
static double GetDouble (string key)
 Returns the double value associated with the specified key.
 
static string GetString (string key)
 Returns the string value associated with the specified key.
 
static byte[] GetByteArray (string key)
 Returns the array object associated with the specified key.

 
static bool HasKey (string key)
 Returns true if key exists in the data snapshot.
 
static void SetBool (string key, bool value)
 Sets a boolean value for the specified key in the cloud data store.
 
static void SetInt (string key, int value)
 Sets a interger value for the specified key in the cloud data store.
 
static void SetLong (string key, long value)
 Sets a long value for the specified key in the cloud data store.
 
static void SetFloat (string key, float value)
 Sets a float value for the specified key in the cloud data store.
 
static void SetDouble (string key, double value)
 Sets a double value for the specified key in the cloud data store.
 
static void SetString (string key, string value)
 Sets a string value for the specified key in the cloud data store.
 
static void SetByteArray (string key, byte[] value)
 Sets an array object for the specified key in the cloud data store.
 
static void Synchronize (Callback< CloudServicesSynchronizeResult > callback=null)
 Explicitly synchronizes in-memory data with those stored on disk.
 
static void RemoveKey (string key)
 Removes the value associated with the specified key from the cloud data store.
 

Events

static EventCallback< CloudServicesUserChangeResultOnUserChange
 Event that will be called when cloud user changed.
 
static Callback< CloudServicesSavedDataChangeResultOnSavedDataChange
 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.
 
static Callback< CloudServicesSynchronizeResultOnSynchronizeComplete
 Event that will be called when the synchronize request is finished.
 

Detailed Description

You can use to make preference, configuration, and app-state data available to every instance of your app on every device connected to a user’s cloud service account. You can store primitive values as well as object types: IList and IDictionary.

When you use this feature on iOS device, iCloud service will be used. Whereas on Android, it will use Google Cloud service. For setup instructions on iOS, read Adding iCloud Support, Similarly for Android, see .

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 eCloudDataStoreValueChangeReason.QUOTA_VIOLATION.

Member Function Documentation

◆ GetBool()

static bool GetBool ( string key)
static
Returns
The boolean value associated with the specified key, that value is returned. or false if the key was not found.
Parameters
keyA string used to identify the value stored in the cloud data store.

Referenced by CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetInt()

static int GetInt ( string key)
static
Returns
The integer value associated with the specified key, that value is returned. or 0 if the key was not found.
Parameters
keyA string used to identify the value stored in the cloud data store.

References CloudServices.GetLong().

Referenced by CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetLong()

static long GetLong ( string key)
static
Returns
The long value associated with the specified key or 0 if the key was not found.
Parameters
keyA string used to identify the value stored in the cloud data store.

Referenced by CloudServices.GetInt(), and CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetFloat()

static float GetFloat ( string key)
static
Returns
The float value associated with the specified key or 0 if the key was not found.
Parameters
keyA string used to identify the value stored in the cloud data store.

References CloudServices.GetDouble().

Referenced by CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetDouble()

static double GetDouble ( string key)
static
Returns
The double value associated with the specified key or 0 if the key was not found.
Parameters
keyA string used to identify the value stored in the cloud data store.

Referenced by CloudServices.GetFloat(), and CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetString()

static string GetString ( string key)
static
Returns
The string associated with the specified key, or null if the key was not found or its value is not an string object.
Parameters
keyA string used to identify the value stored in the cloud data store.

Referenced by CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ GetByteArray()

static byte[] GetByteArray ( string key)
static
Returns
Array object associated with the specified key, or null if the key was not found or its value is not an Array object.
Parameters
keyA string used to identify the value stored in the cloud data store.

Referenced by CloudServicesUtility.TryGetCloudAndLocalCacheValues< T >().

◆ HasKey()

static bool HasKey ( string key)
static
Parameters
keyA string used to identify the value stored in the current data snapshot.
Returns
true if key exists in the data snapshot, otherwise false.

◆ SetBool()

static void SetBool ( string key,
bool value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe boolean value to store.

References KeyValueDataStore.SetBool().

◆ SetInt()

static void SetInt ( string key,
int value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe integer value to store.

References CloudServices.SetLong().

◆ SetLong()

static void SetLong ( string key,
long value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe long value to store.

References KeyValueDataStore.SetLong().

Referenced by CloudServices.SetInt().

◆ SetFloat()

static void SetFloat ( string key,
float value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe float value to store.

References CloudServices.SetDouble().

◆ SetDouble()

static void SetDouble ( string key,
double value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe double value to store.

References KeyValueDataStore.SetDouble().

Referenced by CloudServices.SetFloat().

◆ SetString()

static void SetString ( string key,
string value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueThe string value to store.

References KeyValueDataStore.SetString().

◆ SetByteArray()

static void SetByteArray ( string key,
byte[] value )
static
Parameters
keyThe key under which to store the value. The length of this key must not exceed 64 bytes.
valueArray object whose contents has to be stored. The objects in the list must be primitive, IList, IDictionary.

References KeyValueDataStore.SetByteArray().

◆ Synchronize()

static void Synchronize ( Callback< CloudServicesSynchronizeResult > callback = null)
static
Note
OnSynchronizeComplete is triggered, when your app has completed processing synchronisation request.

References CloudServices.OnSynchronizeComplete, and KeyValueDataStore.Synchronize().

◆ RemoveKey()

static void RemoveKey ( string key)
static
Parameters
keyThe key corresponding to the value you want to remove.

References KeyValueDataStore.RemoveKey().

Event Documentation

◆ OnSavedDataChange

Callback<CloudServicesSavedDataChangeResult> OnSavedDataChange
static
Note
This event is triggered ONLY if there are changes between local and cloud data values.