The ICloudControl interface. More...
#include "murl_i_cloud_control.h"
Public Types | |
enum | AccountStatus { ACCOUNT_UNKNOWN , ACCOUNT_NOT_AUTHENTICATED , ACCOUNT_AUTHENTICATED } |
The account states. More... | |
enum | KeyValueStatus { KEYVALUE_STATUS_IDLE , KEYVALUE_STATUS_INITIAL_SYNC , KEYVALUE_STATUS_SERVER_CHANGE , KEYVALUE_STATUS_QUOTA_VIOLATION } |
The key-value store states. More... | |
Public Member Functions | |
virtual AccountStatus | GetAccountStatus ()=0 |
Get the user's cloud account status. More... | |
virtual IPreferencesControl * | GetKeyValueStore ()=0 |
Get the key-value store preference control. More... | |
virtual KeyValueStatus | GetKeyValueStatus () const =0 |
Get the key-value store status. More... | |
virtual const StringArray & | GetChangedKeys () const =0 |
Get the key-value store changed keys. More... | |
virtual Bool | ClearKeyValueStatus ()=0 |
Clear the key-value store status. More... | |
virtual ICloudRecord * | OpenPrivateRecord (const String &recordName, const String &recordType)=0 |
Open a record in the private database from the default container with a given record type name. More... | |
virtual ICloudRecord * | OpenPrivateRecord (const String &recordName, const String &recordType, const String &containerName)=0 |
Open a record in the private database from a specified container with a given record type name. More... | |
virtual ICloudRecord * | OpenPublicRecord (const String &recordName, const String &recordType)=0 |
Open a record in the public database from the default container with a given record type name. More... | |
virtual ICloudRecord * | OpenPublicRecord (const String &recordName, const String &recordType, const String &containerName)=0 |
Open a record in the public database from a specified container with a given record type name. More... | |
virtual Bool | CloseRecord (ICloudRecord *&record, Bool autoSave=false)=0 |
Close a record. More... | |
Public Member Functions inherited from Murl::IControlable | |
virtual const String & | GetName () const =0 |
Get the controlable's name. More... | |
virtual void | FrameUpdate ()=0 |
Is executed in the platform thread context each frame tick. | |
virtual void | LogicUpdate ()=0 |
Is executed in the logic thread context each logic tick. | |
virtual void | ConfigChanged (const IAppConfiguration *appConfig)=0 |
Notification of changed configuration. More... | |
Detailed Description
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.
Member Enumeration Documentation
◆ AccountStatus
The account states.
Enumerator | |
---|---|
ACCOUNT_UNKNOWN | Unknown account status, call GetAccountStatus() again next tick. |
ACCOUNT_NOT_AUTHENTICATED | The user is not authenticated. |
ACCOUNT_AUTHENTICATED | The user is authenticated. |
◆ KeyValueStatus
The key-value store states.
Member Function Documentation
◆ GetAccountStatus()
|
pure virtual |
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.
- Returns
- true if the user is signed in.
◆ GetKeyValueStore()
|
pure virtual |
Get the key-value store preference control.
- Returns
- The key-value store preference control.
◆ GetKeyValueStatus()
|
pure virtual |
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().
- Returns
- The key-value store status.
◆ GetChangedKeys()
|
pure virtual |
Get the key-value store changed keys.
- Returns
- The key-value store changed keys.
◆ ClearKeyValueStatus()
|
pure virtual |
Clear the key-value store status.
Set the key-value store status to KeyValueStatus::KEYVALUE_STATUS_IDLE and clears the changed keys.
- Returns
- true if successful.
◆ OpenPrivateRecord() [1/2]
|
pure virtual |
Open a record in the private database from the default container with a given record type name.
- Parameters
-
recordName The record name. recordType The record type name.
- Returns
- The record object.
◆ OpenPrivateRecord() [2/2]
|
pure virtual |
Open a record in the private database from a specified container with a given record type name.
- Parameters
-
recordName The record name. recordType The record type name. containerName The container name.
- Returns
- The record object.
◆ OpenPublicRecord() [1/2]
|
pure virtual |
Open a record in the public database from the default container with a given record type name.
- Parameters
-
recordName The record name. recordType The record type name.
- Returns
- The record object.
◆ OpenPublicRecord() [2/2]
|
pure virtual |
Open a record in the public database from a specified container with a given record type name.
- Parameters
-
recordName The record name. recordType The record type name. containerName The container name.
- Returns
- The record object.
◆ CloseRecord()
|
pure virtual |
Close a record.
- Parameters
-
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.
- Returns
- true if successful.
The documentation for this interface was generated from the following file:
- murl_i_cloud_control.h