![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
The account states.
Murl.ICloudControl.ACCOUNT_UNKNOWN | Unknown account status, call GetAccountStatus() again next tick. |
Murl.ICloudControl.ACCOUNT_NOT_AUTHENTICATED | The user is not authenticated. |
Murl.ICloudControl.ACCOUNT_AUTHENTICATED | The user is authenticated. |
The key-value store states.
Murl.ICloudControl.KEYVALUE_STATUS_IDLE | The idle state. |
Murl.ICloudControl.KEYVALUE_STATUS_INITIAL_SYNC | Your 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_CHANGE | A 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_VIOLATION | Your app’s key-value store has exceeded its space quota on the iCloud server. |
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.
Murl.ICloudControl.AccountStatus GetAccountStatus()
Get the key-value store preference control.
Murl.IPreferencesControl GetKeyValueStore()
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()
Get the key-value store changed keys.
Murl.Array.String GetChangedKeys()
Clear the key-value store status. Set the key-value store status to KeyValueStatus::KEYVALUE_STATUS_IDLE and clears the changed keys.
Boolean ClearKeyValueStatus()
Open a record in the private database from the default container with a given record type name.
Murl.ICloudRecord OpenPrivateRecord(String recordName, String recordType)
recordName | The record name. |
recordType | The record type name. |
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)
recordName | The record name. |
recordType | The record type name. |
containerName | The container name. |
Open a record in the public database from the default container with a given record type name.
Murl.ICloudRecord OpenPublicRecord(String recordName, String recordType)
recordName | The record name. |
recordType | The record type name. |
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)
recordName | The record name. |
recordType | The record type name. |
containerName | The container name. |
Close a record.
Boolean, Murl.ICloudRecord CloseRecord(Murl.ICloudRecord record, Boolean autoSave)
record | A reference to the record object to destroy. After destruction the pointer is set to null. |
autoSave | If true the record's ICloudRecord::SaveRecord() method is executed before closing the record. |