API/Autodoc/Classes/URuStoreAppUpdateManager.en.md


URuStoreAppUpdateManager

The class implements an API for three update methods. Currently supported are: deferred, silent (without RuStore UI), and forced updates.

#include <URuStoreAppUpdateManager.h>

Inherits from UObject, IRuStoreInstallStateUpdateListenerInterface, RuStoreSDK::RuStoreListenerContainer

Public Functions

Name
bool GetIsInitialized
Checks whether the manager is initialized.
void SetAllowNativeErrorHandling
Error handling in the native SDK.
bool Init
Initializes the URuStoreAppUpdateManager singleton.
void Dispose
Deinitializes the singleton if no further work with the object is planned.
void ConditionalBeginDestroy
long GetAppUpdateInfo
Checks for available updates.
long StartUpdateFlow
Starts the procedure for downloading an application update.
long CompleteUpdate
Starts the update installation procedure.
bool CheckIsImmediateUpdateAllowed
Checks whether a forced update is available.
int64 RegisterListener
Registers a listener for the update download status.
bool UnregisterListener
If the listener is no longer needed, use the UnregisterListener() method to remove it, passing the previously registered listener to the method.
void GetAppUpdateInfo(int64 & requestId)
void StartUpdateFlow(int64 & requestId, EURuStoreAppUpdateOptions appUpdateOptions)
void CompleteUpdate(int64 & requestId, EURuStoreAppUpdateOptions appUpdateOptions)
void OnStateUpdated_Implementation(int64 listenerId, FURuStoreInstallState & state) override
URuStoreAppUpdateManager * Instance
Gets the URuStoreAppUpdateManager instance.

Public Attributes

Name
const FString PluginVersion — Plugin version.
FRuStoreGetAppUpdateInfoErrorDelegate OnGetAppUpdateInfoError
FRuStoreGetAppUpdateInfoResponseDelegate OnGetAppUpdateInfoResponse
FRuStoreStartUpdateFlowErrorDelegate OnStartUpdateFlowError
FRuStoreStartUpdateFlowResponseDelegate OnStartUpdateFlowResponse
FRuStoreCompleteUpdateErrorDelegate OnCompleteUpdateError
FRuStoreOnStateUpdatedInstanceDelegate OnStateUpdatedInstanceEvent

Additional inherited members

Public Functions inherited from IRuStoreInstallStateUpdateListenerInterface

Name
void OnStateUpdated(int64 listenerId, FURuStoreInstallState & state)
Handler for the update installation callback.

Public Functions inherited from RuStoreSDK::RuStoreListenerContainer

Name
TSharedPtr< RuStoreListener, ESPMode::ThreadSafe > ListenerBind(RuStoreListener * item)
void ListenerUnbind(long id)
void ListenerUnbind(RuStoreListener * item)
void ListenerUnbind(TSharedPtr< RuStoreListener, ESPMode::ThreadSafe > item)
void ListenerRemoveAll()

function GetIsInitialized

bool GetIsInitialized()

Checks whether the manager is initialized.

Return: Returns true if the singleton is initialized, otherwise — false.

function SetAllowNativeErrorHandling

void SetAllowNativeErrorHandling(
    bool value
)

Error handling in the native SDK.

Parameters:

  • value true — enables error handling, false — disables it.

function Init

bool Init()

Initializes the URuStoreAppUpdateManager singleton.

Return: Returns true if initialization was successful, otherwise — false.

function Dispose

void Dispose()

Deinitializes the singleton if no further work with the object is planned.

function ConditionalBeginDestroy

void ConditionalBeginDestroy()

function GetAppUpdateInfo

long GetAppUpdateInfo(
    TFunction< void(long, TSharedPtr< FURuStoreAppUpdateInfo, ESPMode::ThreadSafe >)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Checks for available updates.

Parameters:

  • onSuccess Action performed on successful completion of the operation. Returns a requestId of type long and a FURuStoreAppUpdateInfo object with information about whether an update is needed.
  • onFailure Action performed in case of an error. Returns a requestId of type long and a FURuStoreError object with error information.

Return: Returns a requestId unique within a single application launch.

function StartUpdateFlow

long StartUpdateFlow(
    EURuStoreAppUpdateOptions appUpdateOptions,
    TFunction< void(long, EURuStoreUpdateFlowResult)> onSuccess,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Starts the procedure for downloading an application update.

Parameters:

  • appUpdateOptions The type of update download procedure.
  • onSuccess Action performed on successful completion of the operation. Returns an EURuStoreUpdateFlowResult object with information about the update operation result.
  • onFailure Action performed in case of an error. Returns a requestId of type long and a FURuStoreError object with error information.

Return: Returns a requestId unique within a single application launch.

function CompleteUpdate

long CompleteUpdate(
    EURuStoreAppUpdateOptions appUpdateOptions,
    TFunction< void(long, TSharedPtr< FURuStoreError, ESPMode::ThreadSafe >)> onFailure
)

Starts the update installation procedure.

Parameters:

  • appUpdateOptions The type of update completion procedure.
  • onFailure Action performed in case of an error. Returns a requestId of type long and a FURuStoreError object with error information.

Return: Returns a requestId unique within a single application launch.

function CheckIsImmediateUpdateAllowed

bool CheckIsImmediateUpdateAllowed()

Checks whether a forced update is available.

Return: Returns true if forced update is available, otherwise — false.

function RegisterListener

int64 RegisterListener(
    TScriptInterface< IRuStoreInstallStateUpdateListenerInterface > stateListener
)

Registers a listener for the update download status.

Parameters:

Return: Returns a requestId unique within a single application launch.

function UnregisterListener

bool UnregisterListener(
    TScriptInterface< IRuStoreInstallStateUpdateListenerInterface > stateListener
)

If the listener is no longer needed, use the UnregisterListener() method to remove it, passing the previously registered listener to the method.

Parameters:

Return: Returns true if the provided listener was found in the listener list and removed, otherwise — false.

function GetAppUpdateInfo

void GetAppUpdateInfo(
    int64 & requestId
)

function StartUpdateFlow

void StartUpdateFlow(
    int64 & requestId,
    EURuStoreAppUpdateOptions appUpdateOptions
)

function CompleteUpdate

void CompleteUpdate(
    int64 & requestId,
    EURuStoreAppUpdateOptions appUpdateOptions
)

function OnStateUpdated_Implementation

void OnStateUpdated_Implementation(
    int64 listenerId,
    FURuStoreInstallState & state
) override

function Instance

static URuStoreAppUpdateManager * Instance()

Gets the URuStoreAppUpdateManager instance.

Return: Returns a pointer to the single instance of URuStoreAppUpdateManager (Singleton pattern implementation). If the instance has not been created yet, it creates it.

variable PluginVersion

static const FString PluginVersion = "10.5.1";

Plugin version.

variable OnGetAppUpdateInfoError

FRuStoreGetAppUpdateInfoErrorDelegate OnGetAppUpdateInfoError;

variable OnGetAppUpdateInfoResponse

FRuStoreGetAppUpdateInfoResponseDelegate OnGetAppUpdateInfoResponse;

variable OnStartUpdateFlowError

FRuStoreStartUpdateFlowErrorDelegate OnStartUpdateFlowError;

variable OnStartUpdateFlowResponse

FRuStoreStartUpdateFlowResponseDelegate OnStartUpdateFlowResponse;

variable OnCompleteUpdateError

FRuStoreCompleteUpdateErrorDelegate OnCompleteUpdateError;

variable OnStateUpdatedInstanceEvent

FRuStoreOnStateUpdatedInstanceDelegate OnStateUpdatedInstanceEvent;

Назад