Screen Properties
1. Set screen orientation (setDeviceOrientation)
Set the device's screen orientation to landscape or portrait. If you need to change the orientation only on a specific screen, be sure to restore the original orientation when leaving the screen.
Signature
function setDeviceOrientation(options: { type: 'portrait' | 'landscape' }): Promise<void>;Parameters
options.type · Required ·
'portrait' | 'landscape'Specifies the screen orientation.
portraitis portrait mode,landscapeis landscape mode.
Example
import { setDeviceOrientation } from '@apps-in-toss/web-framework';
setDeviceOrientation({ type: 'landscape' });import { setDeviceOrientation } from '@apps-in-toss/web-framework';
import { useEffect } from 'react';
function VideoScreen() {
useEffect(() => {
setDeviceOrientation({ type: 'landscape' });
return () => {
setDeviceOrientation({ type: 'portrait' }); // Restore it when leaving the screen.
};
}, []);
}import { setDeviceOrientation } from '@apps-in-toss/framework';
import { useEffect } from 'react';
function VideoScreen() {
useEffect(() => {
setDeviceOrientation({ type: 'landscape' });
return () => {
setDeviceOrientation({ type: 'portrait' }); // Restore it when leaving the screen.
};
}, []);
}2. Set screen to always stay on (setScreenAwakeMode)
Prevent the screen from turning off automatically. Useful for situations where the screen needs to stay on, such as webtoons, videos, or reading documents. If used only on a specific screen, be sure to disable it when leaving the screen.
Signature
function setScreenAwakeMode(options: { enabled: boolean }): Promise<{ enabled: boolean }>;Parameters
options.enabled · Required ·
booleantrueIf set to this value, the screen won't turn off,falseIf set to this value, it turns off according to the default screen saver timeout.
Example
3. Block screen capture (setSecureScreen)
Block screen capture at the native level. Can be used on screens that display sensitive information such as account balances and transaction history.
Signature
Parameters
options.enabled · Required ·
booleantrueIf set to this value, screen capture is blocked,falseIf set to this value, it is allowed.
Example
Last updated
Was this helpful?