_requestWithCallback(onGranted: () => void, onDenied: () => void) {
        const existing = this.get();

        var resolved = false;
        var resolve = (result = this._win.Notification.permission) => {
            if (resolved) return;
            resolved = true;
            if (typeof result === 'undefined' && this._win.webkitNotifications)
                result = this._win.webkitNotifications.checkPermission();
            if (result === this.GRANTED || result === 0) {
                if (onGranted) onGranted();
            } else if (onDenied) onDenied();
        };
        var request;

        /* Permissions already set */
        if (existing !== this.DEFAULT) {
            resolve(existing);
        } else if (
            this._win.webkitNotifications &&
            this._win.webkitNotifications.checkPermission
        ) {
            /* Safari 6+, Legacy webkit browsers */
            this._win.webkitNotifications.requestPermission(resolve);
        } else if (
            this._win.Notification &&
            this._win.Notification.requestPermission
        ) {
            /* Safari 12+ */
            /* This resolve argument will only be used in Safari */
            /* CHrome, instead, returns a Promise */
            request = this._win.Notification.requestPermission(resolve);
            if (request && request.then) {
                /* Chrome 23+ */
                request.then(resolve).catch(function() {
                    if (onDenied) onDenied();
                });
            }
        } else if (onGranted) {
            /* Let the user continue by default */
            onGranted();
        }
    }
Old permissions implementation deprecated in favor of a promise based one
@deprecated Since V1.0.4
@param {Function} onGranted - Function to execute once permission is granted
@param {Function} onDenied - Function to execute once permission is denied
@return {void}