Skip to main content

System API

System API

GetSystemInfoSync()

Synchronously retrieves full system information.

Return Value (SystemInfo):

FieldTypeDescription
platformstringPlatform ("ios" / "android")
brandstringDevice brand
modelstringDevice model
systemstringOS and version
pixelRatiofloatPixel ratio
screenWidth / screenHeightfloatScreen size (px)
windowWidth / windowHeightfloatAvailable area (px)
safeAreaSafeAreaSafe area information
benchmarkLevelintPerformance level (Android)
SDKVersionstringSDK version
wifiEnabledboolWi-Fi enabled status
environmentstringAccess environment ("prod" / "dev")
SystemInfo info = TudadaSDK.Instance.GetSystemInfoSync();
Debug.Log("Platform: " + info.platform);
Debug.Log("Screen: " + info.windowWidth + " x " + info.windowHeight);
Debug.Log("SafeArea: " + info.safeArea.width + " x " + info.safeArea.height);
Debug.Log("Model: " + info.model);
Debug.Log("Performance level: " + info.benchmarkLevel);
Debug.Log("Wi-Fi: " + info.wifiEnabled);
Debug.Log("Environment: " + info.environment); // "prod" or "dev"

GetSystemInfo(onSuccess, onFail)

Asynchronously retrieves full system information.

Parameters:

ParameterTypeRequiredDescription
onSuccessAction<SystemInfo>-Success callback
onFailAction<string>-Failure callback
TudadaSDK.Instance.GetSystemInfo(
onSuccess: (info) => Debug.Log("Platform: " + info.platform),
onFail: (err) => Debug.LogError(err)
);

GetWindowInfo()

Synchronously retrieves window/screen size and SafeArea.

Return Value (WindowInfo):

FieldTypeDescription
screenWidthfloatScreen width (px)
screenHeightfloatScreen height (px)
windowWidthfloatAvailable area width (px)
windowHeightfloatAvailable area height (px)
safeAreaSafeAreaSafe area information
WindowInfo windowInfo = TudadaSDK.Instance.GetWindowInfo();
Debug.Log("SafeArea top: " + windowInfo.safeArea.top);
Debug.Log("Screen size: " + windowInfo.screenWidth + " x " + windowInfo.screenHeight);

GetAppBaseInfo()

Synchronously retrieves app/SDK basic information.

Return Value (AppBaseInfo):

FieldTypeDescription
SDKVersionstringSDK version
themestringTheme
environmentstringAccess environment ("prod" / "dev")
AppBaseInfo appInfo = TudadaSDK.Instance.GetAppBaseInfo();
Debug.Log("SDK version: " + appInfo.SDKVersion);
Debug.Log("Theme: " + appInfo.theme);
Debug.Log("Environment: " + appInfo.environment); // "prod" or "dev"

GetDeviceInfo()

Synchronously retrieves device hardware information.

Return Value (DeviceInfo):

FieldTypeDescription
brandstringDevice brand
modelstringDevice model
DeviceInfo deviceInfo = TudadaSDK.Instance.GetDeviceInfo();
Debug.Log("Brand: " + deviceInfo.brand);
Debug.Log("Model: " + deviceInfo.model);

GetMenuButtonBoundingClientRect()

Synchronously retrieves the menu button position. Used for UI layout.

Return Value (MenuButtonRect):

FieldTypeDescription
topfloatTop position
rightfloatRight position
bottomfloatBottom position
leftfloatLeft position
widthfloatWidth
heightfloatHeight
MenuButtonRect rect = TudadaSDK.Instance.GetMenuButtonBoundingClientRect();
Debug.Log("Menu button position: top=" + rect.top + ", right=" + rect.right);