Safe area
getSafeArea()
Section titled “getSafeArea()”Obtain safe area information (parsed from UserAgent) to adapt to devices such as notched screens and full-screen displays.
const safeArea = SuperSDK.getSafeArea();console.log(safeArea);// { top: 88, bottom: 34 }// top: Status bar height (physical pixels)// bottom: Navigation bar height (physical pixels)Return Value:
| Parameter | Type | Description |
|---|---|---|
| top | number | Status bar safe area height (physical pixels) |
| bottom | number | Navigation bar safe area height (physical pixels) |
Note: This method is synchronous and returns the result directly. The safe area information is injected by the client via the UserAgent (
SafeAreaTop/xx SafeAreaBottom/xx). Correct values can only be obtained after the client callssetSafeAreaorfitSystemWindows.