Murl Engine Lua Addon API  Version 1.0 beta
Murl.ICloudControl

The ICloudControl interface.

The cloud control must be enabled during IApp::Configure() by setting IEngineConfiguration::SetCloudControlEnable().
On iOS/OSX/tvOS this control follows the iCloud guides:
An app has access to both a public and private database in each container. The public database is for storing user and app data that is shared between all instances of the app. By default, all users can read the public database, but they need to enter iCloud credentials to write to the public database. There’s a private database for each user of your app, but the app only has access to the private database of the current user. The user has to enter iCloud credentials for the app to read and write to the private database.

See also
CloudKit Framework Reference.


Table members

Inherited


Murl.IControlable

Enumerations


AccountStatus

The account states.

Murl.ICloudControl.ACCOUNT_UNKNOWNUnknown account status, call GetAccountStatus() again next tick.
Murl.ICloudControl.ACCOUNT_NOT_AUTHENTICATEDThe user is not authenticated.
Murl.ICloudControl.ACCOUNT_AUTHENTICATEDThe user is authenticated.

KeyValueStatus

The key-value store states.

Murl.ICloudControl.KEYVALUE_STATUS_IDLEThe idle state.
Murl.ICloudControl.KEYVALUE_STATUS_INITIAL_SYNCYour attempt to write to key-value storage was discarded because an initial download from iCloud has not yet happened. That is, before you can first write key-value data, the system must ensure that your app’s local, on-disk cache matches the truth in iCloud.
Murl.ICloudControl.KEYVALUE_STATUS_SERVER_CHANGEA value changed in iCloud. This occurs when another device, running another instance of your app and attached to the same iCloud account, uploads a new value.
Murl.ICloudControl.KEYVALUE_STATUS_QUOTA_VIOLATIONYour app’s key-value store has exceeded its space quota on the iCloud server.


Functions



Methods


GetAccountStatus()

Get the user's cloud account status. On iOS/OSX/tvOS follow the iCloud guides:
Before saving records, verify that the user is signed in to their iCloud account. If the user is not signed in, present an alert instructing the user how to enter their iCloud credentials and enable iCloud Drive.

See also
CloudKit Framework Reference.

Murl.ICloudControl.AccountStatus GetAccountStatus()

Returns
Murl.ICloudControl.AccountStatus true if the user is signed in.

GetKeyValueStore()

Get the key-value store preference control.

Murl.IPreferencesControl GetKeyValueStore()

Returns
Murl.IPreferencesControl The key-value store preference control.

GetKeyValueStatus()

Get the key-value store status. If the status changes to KeyValueStatus::KEYVALUE_STATUS_INITIAL_SYNC or KeyValueStatus::KEYVALUE_STATUS_SERVER_CHANGE the changed keys can be evaluated by GetChangedKeys(). To receive further changes, the status must be cleared by calling ClearKeyValueStatus().

Murl.ICloudControl.KeyValueStatus GetKeyValueStatus()

Returns
Murl.ICloudControl.KeyValueStatus The key-value store status.

GetChangedKeys()

Get the key-value store changed keys.

Murl.Array.String GetChangedKeys()

Returns
Murl.Array.String The key-value store changed keys.

ClearKeyValueStatus()

Clear the key-value store status. Set the key-value store status to KeyValueStatus::KEYVALUE_STATUS_IDLE and clears the changed keys.

Boolean ClearKeyValueStatus()

Returns
Boolean true if successful.

OpenPrivateRecord(recordName, recordType)

Open a record in the private database from the default container with a given record type name.

Murl.ICloudRecord OpenPrivateRecord(String recordName, String recordType)

Parameters
recordNameThe record name.
recordTypeThe record type name.
Returns
Murl.ICloudRecord The record object.

OpenPrivateRecord(recordName, recordType, containerName)

Open a record in the private database from a specified container with a given record type name.

Murl.ICloudRecord OpenPrivateRecord(String recordName, String recordType, String containerName)

Parameters
recordNameThe record name.
recordTypeThe record type name.
containerNameThe container name.
Returns
Murl.ICloudRecord The record object.

OpenPublicRecord(recordName, recordType)

Open a record in the public database from the default container with a given record type name.

Murl.ICloudRecord OpenPublicRecord(String recordName, String recordType)

Parameters
recordNameThe record name.
recordTypeThe record type name.
Returns
Murl.ICloudRecord The record object.

OpenPublicRecord(recordName, recordType, containerName)

Open a record in the public database from a specified container with a given record type name.

Murl.ICloudRecord OpenPublicRecord(String recordName, String recordType, String containerName)

Parameters
recordNameThe record name.
recordTypeThe record type name.
containerNameThe container name.
Returns
Murl.ICloudRecord The record object.

CloseRecord(record, autoSave)

Close a record.

Boolean, Murl.ICloudRecord CloseRecord(Murl.ICloudRecord record, Boolean autoSave)

Parameters
recordA reference to the record object to destroy. After destruction the pointer is set to null.
autoSaveIf true the record's ICloudRecord::SaveRecord() method is executed before closing the record.
Returns
Boolean true if successful.
Murl.ICloudRecord record A reference to the record object to destroy. After destruction the pointer is set to null.