System API
System API
GetSystemInfoSync()
Synchronously retrieves full system information.
Return Value (SystemInfo):
| Field | Type | Description |
|---|---|---|
platform | string | Platform ("ios" / "android") |
brand | string | Device brand |
model | string | Device model |
system | string | OS and version |
pixelRatio | float | Pixel ratio |
screenWidth / screenHeight | float | Screen size (px) |
windowWidth / windowHeight | float | Available area (px) |
safeArea | SafeArea | Safe area information |
benchmarkLevel | int | Performance level (Android) |
SDKVersion | string | SDK version |
wifiEnabled | bool | Wi-Fi enabled status |
environment | string | Access 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
onSuccess | Action<SystemInfo> | - | Success callback |
onFail | Action<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):
| Field | Type | Description |
|---|---|---|
screenWidth | float | Screen width (px) |
screenHeight | float | Screen height (px) |
windowWidth | float | Available area width (px) |
windowHeight | float | Available area height (px) |
safeArea | SafeArea | Safe 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):
| Field | Type | Description |
|---|---|---|
SDKVersion | string | SDK version |
theme | string | Theme |
environment | string | Access 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):
| Field | Type | Description |
|---|---|---|
brand | string | Device brand |
model | string | Device 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):
| Field | Type | Description |
|---|---|---|
top | float | Top position |
right | float | Right position |
bottom | float | Bottom position |
left | float | Left position |
width | float | Width |
height | float | Height |
MenuButtonRect rect = TudadaSDK.Instance.GetMenuButtonBoundingClientRect();
Debug.Log("Menu button position: top=" + rect.top + ", right=" + rect.right);