WakeLock Class

The Screen Wake Lock API of a window (https://w3c.github.io/screen-wake-lock/#the-wakelock-interface, navigator.wakeLock): the locks that prevent the screen from turning off, acquired with WakeLockOptions.Acquire.

public sealed class WakeLock

Methods

NameDescription
Request(WakeLockType)Requests a wake lock (https://w3c.github.io/screen-wake-lock/#the-request-method). The task fails with a NotAllowedError DomException when the document is not fully active, is not allowed to use the screen-wake-lock feature, is hidden, or when the screen-wake-lock permission is denied.

Request(WakeLockType)

WakeLock.cs

Requests a wake lock (https://w3c.github.io/screen-wake-lock/#the-request-method). The task fails with a NotAllowedError DomException when the document is not fully active, is not allowed to use the screen-wake-lock feature, is hidden, or when the screen-wake-lock permission is denied.

public Task<WakeLockSentinel> Request(WakeLockType type = WakeLockType.Screen)