You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/plugins-tutorials/en/capacitor-keep-awake.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,41 @@
1
1
---
2
2
locale: en
3
3
---
4
-
# Using @capgo/keep-awake Package
4
+
# Using @capgo/capacitor-keep-awake Package
5
5
6
-
The `@capgo/keep-awake` package allows you to prevent the device screen from dimming or sleeping. This is useful for video players, navigation apps, games, presentations, and any app that needs the screen to stay on. In this tutorial, we will guide you through the process of installing and using this package in your Capacitor app.
6
+
The `@capgo/capacitor-keep-awake` package allows you to prevent the device screen from dimming or sleeping. This is useful for video players, navigation apps, games, presentations, and any app that needs the screen to stay on. In this tutorial, we will guide you through the process of installing and using this package in your Capacitor app.
7
7
8
8
## Installation
9
9
10
-
To install the `@capgo/keep-awake` package, run the following command in your project's root directory:
10
+
To install the `@capgo/capacitor-keep-awake` package, run the following command in your project's root directory:
11
11
12
12
```bash
13
-
npm install @capgo/keep-awake
13
+
npm install @capgo/capacitor-keep-awake
14
14
npx cap sync
15
15
```
16
16
17
17
## iOS Setup
18
18
19
-
The `@capgo/keep-awake` package works out of the box on iOS, so no additional setup is required.
19
+
The `@capgo/capacitor-keep-awake` package works out of the box on iOS, so no additional setup is required.
20
20
21
21
## Android Setup
22
22
23
-
The `@capgo/keep-awake` package works out of the box on Android. No permissions are required.
23
+
The `@capgo/capacitor-keep-awake` package works out of the box on Android. No permissions are required.
24
24
25
25
## Web Setup
26
26
27
27
On the web, the plugin uses the Screen Wake Lock API. Not all browsers support this API, so always check with `isSupported()` first.
28
28
29
29
## API
30
30
31
-
The `@capgo/keep-awake` package provides the following API methods:
31
+
The `@capgo/capacitor-keep-awake` package provides the following API methods:
32
32
33
33
### keepAwake()
34
34
35
35
This method prevents the device from dimming the screen.
@@ -233,4 +233,4 @@ function updateUI(isEnabled: boolean) {
233
233
234
234
5.**Consider battery impact** - Keeping the screen on drains battery faster. Only use when necessary.
235
235
236
-
That's it! You have successfully learned how to use the `@capgo/keep-awake` package in your Capacitor app to prevent the screen from dimming.
236
+
That's it! You have successfully learned how to use the `@capgo/capacitor-keep-awake` package in your Capacitor app to prevent the screen from dimming.
0 commit comments