Table of Contents

Class WakeLock

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The WakeLock interface of the Screen Wake Lock API can be used to request a lock that prevents device screens from dimming or locking when an application needs to keep running.

[Value("WakeLock")]
public class WakeLock
Inheritance
WakeLock
Inherited Members

Remarks

This interface, and hence the system wake lock, is exposed through the WakeLock property.

-Stay awake with the Screen Wake Lock API

See also on MDN

Constructors

WakeLock()

public WakeLock()

Methods

Request(WakeLockType)

The request() method of the WakeLock interface returns a {{jsxref("Promise")}} that fulfills with a WakeLockSentinel object if the system screen wake lock is granted.

[Value("request")]
public Task<WakeLockSentinel> Request(WakeLockType type = WakeLockType.Screen)

Parameters

type WakeLockType

Returns

Task<WakeLockSentinel>

A {{jsxref("Promise")}} that resolves with a WakeLockSentinel object.

Remarks

The screen wake lock prevents device screens from dimming or locking when an application needs to keep running.

-Stay awake with the Screen Wake Lock API

See also on MDN