# 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
