Check if the browser's notification api supports promise based requests.
- Since
- 1.0.0
Returns:
Whether the browser supports promise based notifications or not.
- Type:
- boolean
Example
import { checkNotificationPromise } from "@gravityforms/utils";
function Example() {
if ( checkNotificationPromise() ) {
window.Notification.requestPermission().then( ( permission ) => {
handlePermission();
} );
} else {
window.Notification.requestPermission( ( permission ) => {
handlePermission();
} );
}
};