获取系统信息
注意事项:
前提条件 | 无 |
业务背景 | 无 |
使用限制 | 无 |
注意事项 | 无 |
相关教程 | 无 |
TT.GetSystemInfo
6.0.0 开始支持本方法
获取系统信息。
语法
public static TTSystemInfo GetSystemInfo();
代码示例
void PrintSystemInfo() { if (CanIUse.GetSystemInfo) { var systemInfo = TT.GetSystemInfo(); Debug.Log(JsonUtility.ToJson(systemInfo)); } else { Debug.Log("接口不兼容"); } }
TTSystemInfo
属性说明
属性名 | 类型 | 说明 |
hostName | string | 当前宿主名,如 Douyin |
hostVersion | string | 当前宿主版本号,如 19.2.0 |
ttVersion | string | TTContainer 底层框架版本号 |
brand | string | 手机设备制造商,如 Apple、samsung |
model | string | 手机品牌,如 iPhone 12、SM-G9880 |
platform | string | 操作系统,如 ios、android |
system | string | 系统版本,如 iOS 15.1.1、Android 11 |
language | string | 系统语言,如 zh_CN |
sdkVersion | string | 客户端基础库版本 |
pixelRatio | double | 设备像素比 |
screenHeight | int | 屏幕高度,单位逻辑像素 |
screenWidth | int | 屏幕宽度,单位逻辑像素 |
statusBarHeight | int | 状态栏的高度 |
safeArea | SafeArea | 在竖屏正方向下的安全区域 |
deviceScore | DeviceScore |