Skip to main content
Version: 5.11.8

GetLatestVersion

public BackendReturnObject GetLatestVersion();

Description

The latest version of information registered to the console is received.
This function is available on Android and iOS devices. In the editor, an error will be returned.

Example

Synchronous

Backend.Utils.GetLatestVersion();

//Example(You can use the same logic asynchronously and in SendQueue.)
var bro = Backend.Utils.GetLatestVersion();
string version = bro.GetReturnValuetoJSON()["version"].ToString();
//If the version is up to date
if(version == Application.version)
{
return;
}

//If the app's current version and the version set in Version Management do not match
int forceUpdate = bro.GetReturnValuetoJSON()["type"].ToString();
if(forceUpdate == "1")
{
Debug.Log("Would you like to update? y/n");
}
else if(forceUpdate == "2")
{
Debug.Log("Update is required. Please proceed with the update in the store");

//Unity method that allows you to visit the app's store
#if UNITY_ANDROID
Application.OpenURL("market://details?id=" + Application.identifier);
#elif UNITY_IOS
Application.OpenURL("https://itunes.apple.com/kr/app/apple-store/" + "id1461432877");
#endif
}

Asynchronous

Backend.Utils.GetLatestVersion((callback) => 
{
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.Utils.GetLatestVersion, (callback) => 
{
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

When called in non-Android and non-iOS devices errorCode : NotFoundException

When the platform version is not registered
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

{
"version" : "1.0.0.1",
"type" : 1
}
typeDescription
1Optional update
2Forced update