Skip to content

Firebase Cloud Messaging errorFirebase: “messaging/permission-blocked” (notification permission blocked)

messaging/permission-blocked is the Firebase Cloud Messaging web error for a browser where the user blocked notifications for your site. The app can’t ask again. Check Notification.permission before you ask for a token, and show steps to unblock it in the browser’s site settings.

Short answer

Read Notification.permission before calling getToken(), or register() in the newer API. If it is denied, skip FCM and show a short note on turning notifications back on in site settings. If it is default, ask from a button the user clicks, after explaining why. Serve the page over HTTPS, and check that firebase-messaging-sw.js is at the root.

Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.

Why permission is blocked, and the fix

  1. 01

    The user blocked notifications for the site

    “The user has explicitly denied permission for the current origin to display system notifications.” MDN, Notification.requestPermission()

    Once the user clicks Block, or blocks the site in settings, the browser answers denied without showing a prompt. Only the user can change it.

  2. 02

    Check permission before you register

    “When you need to target an app instance with FCM, first request notification permissions from the user with Notification.requestPermission().” Firebase, Set up a JavaScript client

    Call FCM only when permission is granted, and ask only when it is still default, so blocked users don’t hit the error on every visit. The error surfaces on the call that fetches the token.

    import { getMessaging, getToken } from 'firebase/messaging';
    
    async function enablePush() {
      if (Notification.permission === 'denied') return showUnblockSteps();
      const permission = await Notification.requestPermission();
      if (permission !== 'granted') return;
      const token = await getToken(getMessaging(), { vapidKey: VAPID_KEY });
      await saveToken(token);
    }
  3. 03

    The prompt fires on page load

    Asking the moment the page opens gets many users to click Block, and some browsers quiet or hide prompts that come without a click. Ask from a button, after the user sees why.

  4. 04

    Older code uses getToken()

    “If you are using the deprecated token APIs, you should pass the VAPID key to getToken() instead of register().” Firebase, Set up a JavaScript client

    Firebase now documents register() and onRegistered() for web apps, and marks the token APIs deprecated. Apps on getToken() still work. Check the permission the same way before either call.

  5. 05

    The page isn’t on HTTPS

    “The FCM SDK is supported only in pages served over HTTPS.” Firebase, Set up a JavaScript client

    Service workers need HTTPS, except on localhost. On a plain http preview link, FCM fails before the permission question matters.

Checked against the vendor’s docs on : Firebase docs: Set up a JavaScript Firebase Cloud Messaging client app; MDN: Notification.requestPermission().

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
A buyer in the United States, July 2022. Shopify on Fiverr
All 127 Fiverr reviews

Related: FCM registration token not registered · Expo push notifications not working · Firebase Storage object-not-found · Firebase auth/popup-blocked

Questions

More on this error

Can the app reset the permission?

No. Only the user can, from the site settings in the browser, usually through the icon next to the address bar. To test the prompt again yourself, reset the notification permission for the site there.

Why does it fail on iPhone Safari?

On iPhone and iPad, web push works only for a web app added to the Home Screen. In-app browsers, such as the ones inside social apps, often can’t show notifications at all.

Does this affect the mobile app too?

This error is from the web SDK. On iOS and Android the app asks through the system prompt, and a user who declines has to turn notifications on in the phone’s settings.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.