Login to follow
WakeyWakey

WakeyWakey (ODC)

Stable version 1.0.0 (Compatible with ODC)
Uploaded on 10 October 2025 by Jasper Oudenaarden
WakeyWakey

WakeyWakey (ODC)

Documentation
1.0.0

## 🎯 Use Cases

### 1. Presentation Mode

Perfect for presentations where the screen needs to stay active.

### 2. Long Processes

Ideal for processes that take a long time and require the user to keep the screen active.

### 3. Kiosk Mode

Suitable for kiosk applications where the screen needs to be constantly active.

### 4. Video/Audio Streaming

Useful for media applications where interruptions are undesirable.


## ⚠️ Important Notes


### Browser Compatibility

- **Chrome/Edge**: Fully supported (Android, Windows)

- **Firefox**: Supported (Android, Windows)

- **Safari**: Limited support (iOS 16.4+)

- **Internet Explorer**: Not supported


### Limitations

- Only works in **HTTPS** context

- Can be **cancelled by the system** (low battery, etc.)

- **Automatically deactivated** when app goes to background

- **User permission** may be required


### Best Practices

1. **Always check** if the API is supported

2. **Deactivate** Wake Lock when no longer needed

3. **Inform users** about battery usage

4. **Implement fallback** for unsupported browsers

5. **Test on different devices** and browsers


## 🔍 Error Codes


| Code | Description |

|------|-------------|

| `NOT_SUPPORTED` | Browser does not support Wake Lock API |

| `NOT_ALLOWED` | Access denied (no HTTPS, etc.) |

| `ABORTED` | Request cancelled |

| `ALREADY_ACTIVE` | Wake Lock is already active |

| `ALREADY_RELEASED` | Wake Lock is already released |

| `DEACTIVATION_ERROR` | Error while deactivating |

| `UNKNOWN_ERROR` | Unknown error |


## 🧪 Testing


### Test on different devices:

- **Android** - Chrome, Firefox

- **iOS** - Safari (iOS 16.4+)

- **Desktop** - Chrome, Edge, Firefox


### Test scenarios:

1. **Normal activation/deactivation**

2. **Double activation** (should not give error)

3. **Deactivation without active lock**

4. **App to background** (automatic deactivation)

5. **Page refresh** (automatic cleanup)