puter.notifications.removeDevice()

Websites Puter Apps Node.js Workers

Removes one of the user's devices, so it gets no more push notifications.

This is for Puter's own apps. It needs a signed-in Puter session, and it rejects an app's token with forbidden.

Signing out of a session also removes the devices registered from it.

Removing a 'webpush' device sticks. The website that subscribed that browser doesn't register it again on page loads. The site turns pushes off in that browser the next time a page with onPush() loads or calls status(). Calling enable() on the site turns them back on.

Syntax

puter.notifications.removeDevice(uid)

Parameters

uid (String) (required)

The device's uid, from listDevices().

Return value

A Promise that resolves once the device is removed.

Errors

The promise rejects with device_not_found if the user has no device with that uid, and with push_unavailable if this deployment has no push notification service, as on most self-hosted servers.