TikTok for Developers

Developer Docs

Last updated October 1, 2026

System

Retrieves device and system information, which is essential for creating responsive layouts, optimizing rendering, and tailoring user experiences. The API is available in both synchronous and asynchronous versions to suit different use cases.

TTMinis.game.getSystemInfoSync()

Gets system information synchronously.

Returns

Field

Type

Description

screenWidth

int32

Screen width, in px

screenHeight

int32

Screen height, in px

windowWidth

int32

Available window width, in px

windowHeight

int32

Available window height, in px

devicePixelRatio

double

Device pixel ratio

pixelRatio

double

Device pixel ratio

deviceOrientation

string

Device orientation

system

string

Operating system and version

platform

string

Client platform. Valid values: ios, android.

statusBarHeight

int32

Status bar height

language

string

Language

safeArea

object

Safe area in portrait orientation

SDKVersion

string

SDK version

version

string

Client version number

Example

try {
  const res = TTMinis.game.getSystemInfoSync()
  console.log(res.pixelRatio)
  console.log(res.windowWidth)
  console.log(res.windowHeight)
  console.log(res.language)
  console.log(res.version)
  console.log(res.platform)
} catch (e) {
  // Do something when catch error
}

TTMinis.game.getSystemInfo(opts)

Gets system information asynchronously.

Parameters

Field

Type

Description

Required

success

function

Callback function called when the API call succeeds

No

fail

function

Callback function called when the API call fails

No

complete

function

Callback function called when the API call ends (called on both success and failure)

No

Success callback parameters

Field

Type

Description

screenWidth

int32

Screen width, in px

screenHeight

int32

Screen height, in px

windowWidth

int32

Available window width, in px

windowHeight

int32

Available window height, in px

devicePixelRatio

double

Device pixel ratio

pixelRatio

double

Device pixel ratio

deviceOrientation

string

Device orientation

system

string

Operating system and version

platform

string

Client platform. Valid values: ios, android.

statusBarHeight

int32

Status bar height

language

string

Language

safeArea

object

Safe area in portrait orientation

SDKVersion

string

SDK version

version

string

Client version number

Example

TTMinis.game.getSystemInfo({
  success (res) {
    console.log(res.pixelRatio)
    console.log(res.windowWidth)
    console.log(res.windowHeight)
    console.log(res.language)
    console.log(res.version)
    console.log(res.platform)
  }
})

TTMinis.game.getWindowInfo()

Note: Supported starting from SDK version 0.2.0. Lower versions must be adjusted for compatibility.

Gets window information synchronously.

Returns

Field

Type

Description

pixelRatio

double

Device pixel ratio

screenWidth

int32

Screen width, in px

screenHeight

int32

Screen height, in px

windowWidth

int32

Available window width, in px

windowHeight

int32

Available window height, in px

statusBarHeight

int32

Status bar height, in px

safeArea

object

Safe area in portrait orientation. Some devices do not have a safe area concept and will not return the safeArea field. Developers should handle this case.

screenTop

int32

The y-coordinate of the top edge of the window

Example

const windowInfo = TTMinis.game.getWindowInfo()

console.log(windowInfo.pixelRatio)
console.log(windowInfo.screenWidth)
console.log(windowInfo.screenHeight)
console.log(windowInfo.windowWidth)
console.log(windowInfo.windowHeight)
console.log(windowInfo.statusBarHeight)
console.log(windowInfo.safeArea)
console.log(windowInfo.screenTop)
TikTok for Developers