Skip to main content
Version: SDK-5.11.2

UpdateLocationProperties

public BackendReturnObject UpdateLocationProperties();

Description

Updates the IP-based country information cached within BACKND SDK.

When BACKND's inspector value (Auto Load Location Properties) is checked or autoLoadLocationProperties in BackendCustomSettings is declared true, call the asynchronous method upon initialization, to load and cache the current country information.

The cached value is implemented only when logging in (including token reissuance), and if login is successful, the country information is changed to the matching one.

If an error occurs because the transference to the server has failed upon initialization, you can call the method and synchronize it again.

Country may not be loaded for devices using VPN.

Country information can be called with City, Country, Region, and Language inside Backend.LocationProperties.

Example

Synchronous

Backend.LocationProperties.UpdateLocationProperties();

Debug.Log("Country name : " + Backend.LocationProperties.Country);
Debug.Log("City name : " + Backend.LocationProperties.City);
Debug.Log("Region name : " + Backend.LocationProperties.Region);
Debug.Log("Language name : " + Backend.LocationProperties.Language);

Asynchronous

Backend.LocationProperties.UpdateLocationProperties(callback=>
{
Debug.Log("Country name : " + Backend.LocationProperties.Country);
Debug.Log("City name : " + Backend.LocationProperties.City);
Debug.Log("Region name : " + Backend.LocationProperties.Region);
Debug.Log("Language name : " + Backend.LocationProperties.Language);
});

SendQueue

SendQueue.Enqueue(Backend.LocationProperties.UpdateLocationProperties, callback => 
{
Debug.Log("Country name : " + Backend.LocationProperties.Country);
Debug.Log("City name : " + Backend.LocationProperties.City);
Debug.Log("Region name : " + Backend.LocationProperties.Region);
Debug.Log("Language name : " + Backend.LocationProperties.Language);
});

ReturnCase

Success cases

When the synchronization is successful
statusCode : 204
returnValue : Success

Error cases

When VPN is enabled
statusCode : 400
errorCode : HttpRequestException
message : Response status code does not indicate success: 503(Service Temporarily Unavailable).