> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoyextensions/browser-plugins/native-web-notifications.md).

# Web Notifications (Native)

(part of package '[Web Notifications](/reference/servoyextensions/packages/browser-plugin-packages/web-notifications.md)')

You can access it in code via: **plugins.webnotificationsNative**

## API

### getPermission()

Returns the current permission value as defined by the Web Notifications API. It can contain the following values:\
\- default: implicitly denied\
\- denied: explicitly denied\
\- granted: explicitly granted

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The current permission status for Web Notifications ('default', 'denied', or 'granted').

***

### isPermitted()

Returns whether or not the permission has been granted

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if permission for Web Notifications has been granted; otherwise, false.

***

### isSupported()

Returns whether or not the Web Notification functionality is supported

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if Web Notification functionality is supported; otherwise, false.

***

### requestPermission(callbackMethod)

Requests permission to the user and executes the callback method when done

**Parameters:**

> * {[Function](/reference/servoy-developer/component_and_service_property_types.md#function)} callbackMethod A function that will be executed once the user has granted or denied permission.

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if the permission request was successfully initiated; otherwise, false.

***

### show(title,body,icon,image,tag,onClickCallbackMethod)

Shows a notification

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} title The title of the notification.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} body The body text of the notification.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[icon] URL to an icon image
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[image] URL to a body image
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[tag] Unique identifier for the notification, will be generated if not supplied
> * {[Function](/reference/servoy-developer/component_and_service_property_types.md#function)} \[onClickCallbackMethod] This method will be called if the user clicks on the notification and will pass the tag as an argument

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) Value of the tag (as supplied or generated)

***

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.servoy.com/reference/servoyextensions/browser-plugins/native-web-notifications.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
