{"id":3589,"date":"2026-11-27T10:08:04","date_gmt":"2026-11-27T04:38:04","guid":{"rendered":"https:\/\/larapush.com\/blog\/?p=3589"},"modified":"2026-11-27T10:08:04","modified_gmt":"2026-11-27T04:38:04","slug":"pushsubscriptionchange-event","status":"publish","type":"post","link":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/","title":{"rendered":"How Do You Handle the pushsubscriptionchange Event in Web Push?"},"content":{"rendered":"\n<p><strong>The pushsubscriptionchange event fires in your service worker when the browser changes, renews or loses a web push subscription. Handle it by subscribing again if needed, then sending the new subscription to your server and removing the old endpoint. Chrome supports it from version 138; Firefox and Safari also fire it.<\/strong><\/p>\n\n\n\n<p>Most web push tutorials skip this event, and that&#8217;s how sites quietly lose subscribers. If the browser rotates a subscription and your server never hears about it, you keep sending to a dead endpoint until it returns 410 Gone. Here&#8217;s what the pushsubscriptionchange event is, when it fires, and the handler I&#8217;d use in 2026.<\/p>\n\n\n\n<p>Key facts at a glance:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Where it fires:<\/strong> in the service worker (ServiceWorkerGlobalScope), not on the page.<\/li>\n\n\n\n<li><strong>What it carries:<\/strong> a PushSubscriptionChangeEvent with oldSubscription and newSubscription properties, either of which can be null.<\/li>\n\n\n\n<li><strong>Support (MDN data, November 2026):<\/strong> Chrome and Chromium browsers 138+, Firefox 44+ (old and new subscription properties from Firefox 137), Safari 16+ on macOS.<\/li>\n\n\n\n<li><strong>Spec:<\/strong> defined in the <a href=\"https:\/\/www.w3.org\/TR\/push-api\/\" target=\"_blank\" rel=\"noreferrer noopener\">W3C Push API<\/a>.<\/li>\n\n\n\n<li><strong>Not a full safety net:<\/strong> it may not fire for every change, so pair it with a check on each page visit.<\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_63 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#What_is_the_pushsubscriptionchange_event\" title=\"What is the pushsubscriptionchange event?\">What is the pushsubscriptionchange event?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#When_does_the_pushsubscriptionchange_event_fire\" title=\"When does the pushsubscriptionchange event fire?\">When does the pushsubscriptionchange event fire?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#Which_browsers_support_pushsubscriptionchange\" title=\"Which browsers support pushsubscriptionchange?\">Which browsers support pushsubscriptionchange?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#How_do_you_handle_the_pushsubscriptionchange_event\" title=\"How do you handle the pushsubscriptionchange event?\">How do you handle the pushsubscriptionchange event?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#What_can_go_wrong_in_the_handler\" title=\"What can go wrong in the handler?\">What can go wrong in the handler?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#Is_pushsubscriptionchange_enough_on_its_own\" title=\"Is pushsubscriptionchange enough on its own?\">Is pushsubscriptionchange enough on its own?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#Where_LaraPush_fits\" title=\"Where LaraPush fits\">Where LaraPush fits<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#Frequently_asked_questions\" title=\"Frequently asked questions\">Frequently asked questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_the_pushsubscriptionchange_event\"><\/span>What is the pushsubscriptionchange event?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The pushsubscriptionchange event is the browser&#8217;s way of telling your service worker that the push subscription it knew about is no longer valid. It&#8217;s the only signal you get while the visitor isn&#8217;t on your site.<\/p>\n\n\n\n<p>A web push subscription is a pairing of an endpoint URL at the push service and a set of encryption keys. The browser can replace that pairing on its own. When it does, the old endpoint stops working. If your server still stores it, every message you send to that subscriber fails.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"When_does_the_pushsubscriptionchange_event_fire\"><\/span>When does the pushsubscriptionchange event fire?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It fires when the push service or browser expires, refreshes or invalidates a subscription. The exact triggers differ between browsers, which is why the spec leaves room for each one.<\/p>\n\n\n\n<p>Common situations include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The subscription reached an expiration time set by the push service.<\/li>\n\n\n\n<li>The browser refreshed the subscription&#8217;s keys or endpoint.<\/li>\n\n\n\n<li>The push service invalidated the subscription and the browser created a new one.<\/li>\n\n\n\n<li>The browser lost the subscription because of a data or profile change.<\/li>\n<\/ul>\n\n\n\n<p>Don&#8217;t rely on it when a visitor blocks notifications in site settings. Behaviour varies by browser, and with permission gone your handler can&#8217;t subscribe again anyway. Your server finds out through a 404 or 410 response the next time it sends. My post on the <a href=\"https:\/\/larapush.com\/blog\/web-push-410-gone-expired-subscriptions\/\">web push 410 Gone error<\/a> covers that cleanup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Which_browsers_support_pushsubscriptionchange\"><\/span>Which browsers support pushsubscriptionchange?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>All major desktop engines fire it now, but support arrived at different times. Chrome was the last big holdout and added it in version 138 in 2025.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Browser<\/th><th>pushsubscriptionchange event<\/th><th>oldSubscription \/ newSubscription<\/th><th>Notes (MDN data, November 2026)<\/th><\/tr><\/thead><tbody><tr><td>Chrome, Edge (Chromium), Opera<\/td><td>138+<\/td><td>138+<\/td><td>Desktop and Android<\/td><\/tr><tr><td>Firefox<\/td><td>44+<\/td><td>137+<\/td><td>Before 137, the event had no subscription properties<\/td><\/tr><tr><td>Safari on macOS<\/td><td>16+<\/td><td>16+<\/td><td>macOS Ventura and later<\/td><\/tr><tr><td>Safari on iOS and iPadOS<\/td><td>Inconsistent data<\/td><td>Inconsistent data<\/td><td>Home Screen web apps only; test on a device<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The data comes from <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/ServiceWorkerGlobalScope\/pushsubscriptionchange_event\" target=\"_blank\" rel=\"noreferrer noopener\">MDN&#8217;s pushsubscriptionchange page<\/a> and its compatibility tables. Because older browser versions are still in use, write your handler so it works even when the properties are missing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_you_handle_the_pushsubscriptionchange_event\"><\/span>How do you handle the pushsubscriptionchange event?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Handle it in three steps: get a valid new subscription, send it to your server with the old endpoint, and let the server swap them. Wrap the work in event.waitUntil() so the browser keeps the service worker alive until it finishes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ sw.js\nconst VAPID_PUBLIC_KEY = 'YOUR_PUBLIC_KEY_BASE64URL';\n\nself.addEventListener('pushsubscriptionchange', (event) =&gt; {\n  event.waitUntil((async () =&gt; {\n    const oldEndpoint = event.oldSubscription ? event.oldSubscription.endpoint : null;\n    let sub = event.newSubscription;\n\n    if (!sub) {\n      \/\/ Older browsers: subscribe again with the same VAPID key\n      sub = await self.registration.pushManager.subscribe({\n        userVisibleOnly: true,\n        applicationServerKey: VAPID_PUBLIC_KEY\n      });\n    }\n\n    await fetch('\/api\/push\/resubscribe', {\n      method: 'POST',\n      headers: { 'Content-Type': 'application\/json' },\n      body: JSON.stringify({ oldEndpoint, subscription: sub.toJSON() })\n    });\n  })());\n});<\/code><\/pre>\n\n\n\n<p>On the server, find the row with the old endpoint, replace the endpoint and keys, and keep the subscriber&#8217;s tags and segments. If oldEndpoint is null, treat it as a new subscription. For the widest browser support, convert the Base64URL key to a Uint8Array before passing it as the applicationServerKey.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_can_go_wrong_in_the_handler\"><\/span>What can go wrong in the handler?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Most failures come from three places: missing data, permission and authentication. Plan for each one.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>No old subscription.<\/strong> In some browsers oldSubscription is null, so you can&#8217;t match the old row. Store a first-party subscriber ID in IndexedDB and send it with the request.<\/li>\n\n\n\n<li><strong>Permission is gone.<\/strong> If notifications were blocked, pushManager.subscribe() throws. Catch the error and stop; don&#8217;t loop.<\/li>\n\n\n\n<li><strong>No cookies.<\/strong> A service worker request may not carry a logged-in session. Make the endpoint accept the old endpoint or a stored ID instead of requiring a login.<\/li>\n\n\n\n<li><strong>Different VAPID key.<\/strong> Subscribing again with a new key creates subscriptions that your server can&#8217;t send to. Keep the same key, as I explain in <a href=\"https:\/\/larapush.com\/blog\/vapid-keys-web-push\/\">VAPID keys for web push<\/a>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Is_pushsubscriptionchange_enough_on_its_own\"><\/span>Is pushsubscriptionchange enough on its own?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>No. The event may not fire in every case, and older browser versions might not fire it at all. So I always add a second check: re-sync the subscription whenever the visitor opens your site.<\/p>\n\n\n\n<p>On each page load, call registration.pushManager.getSubscription(). If it returns a subscription, send the endpoint and keys to your server, which updates the row if anything changed. If it returns null but permission is still granted, subscribe again quietly. This catches changes the event missed, and it costs one small request per visit.<\/p>\n\n\n\n<p>Together, the event and the page-load check keep your list close to reality. For a wider look at subscription lifespan, read <a href=\"https:\/\/larapush.com\/blog\/how-long-do-web-push-subscriptions-last\/\">how long web push subscriptions last<\/a>, and for the service worker basics see my guide to the <a href=\"https:\/\/larapush.com\/blog\/service-worker-for-web-push\/\">service worker for web push<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_LaraPush_fits\"><\/span>Where LaraPush fits<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you use a push panel, check that its service worker keeps subscriptions in sync, because that&#8217;s where this logic lives. LaraPush is a self-hosted web push panel that you install on your own VPS, with a one-time licence from $499 (check <a href=\"https:\/\/larapush.com\/pricing\/\">LaraPush pricing<\/a>). It provides the service worker and JavaScript for your site, sends through Firebase Cloud Messaging, and keeps subscriber data on your server. The <a href=\"https:\/\/larapush.com\/guide\/\">setup guide<\/a> covers installation. The trade-offs are no free plan and a server you maintain. For other options, see my roundup of the <a href=\"https:\/\/larapush.com\/blog\/best-push-notification-services-and-tools\/\">best push notification services and tools<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1764236000000\"><strong class=\"schema-faq-question\">Does pushsubscriptionchange fire when a user blocks notifications?<\/strong> <p class=\"schema-faq-answer\">Don&#8217;t count on it. Behaviour varies by browser, and your handler can&#8217;t subscribe again without permission anyway. Your server reliably finds out when the push service returns 404 or 410 on the next send. Delete the subscription at that point. If the visitor allows notifications again later, your page-load check creates and saves a new subscription.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764236001111\"><strong class=\"schema-faq-question\">How can I test the pushsubscriptionchange event?<\/strong> <p class=\"schema-faq-answer\">Testing is awkward, because you can&#8217;t make most browsers rotate a subscription on demand. A practical approach is to extract the handler body into a function, then call it from the page or DevTools console with a fake old endpoint. Check that your server swaps the row correctly and keeps the subscriber&#8217;s segments.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764236002222\"><strong class=\"schema-faq-question\">Why is newSubscription null in my handler?<\/strong> <p class=\"schema-faq-answer\">Some browsers, and older versions of others, fire the event without a new subscription. They expect your service worker to call pushManager.subscribe() again. Do that with the same VAPID public key, then send the result to your server. If subscribing fails, permission is probably gone, so stop there.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764236003333\"><strong class=\"schema-faq-question\">Should I delete the old endpoint right away?<\/strong> <p class=\"schema-faq-answer\">Yes, once your server has saved the new subscription. Replace the old row instead of inserting a second one, so the subscriber doesn&#8217;t get duplicate notifications and your counts stay accurate. If you can&#8217;t match the old endpoint, the 404 or 410 cleanup on the next send removes it.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764236004444\"><strong class=\"schema-faq-question\">Does Firebase Cloud Messaging handle subscription changes for me?<\/strong> <p class=\"schema-faq-answer\">Partly. The Firebase JavaScript SDK refreshes its registration token from the page, and your code should send the latest token to your server whenever getToken() returns it. If you use FCM through your own service worker, keep the page-load re-sync in place so token changes still reach your database.<\/p> <\/div><\/div>\n","protected":false},"excerpt":{"rendered":"The pushsubscriptionchange event fires when a browser renews or loses a push subscription. Browser support, a handler, and a page-load re-sync.","protected":false},"author":7,"featured_media":3597,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":""},"categories":[68],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How Do You Handle the pushsubscriptionchange Event in Web Push?<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Do You Handle the pushsubscriptionchange Event in Web Push?\" \/>\n<meta property=\"og:description\" content=\"The pushsubscriptionchange event fires when a browser renews or loses a push subscription. Browser support, a handler, and a page-load re-sync.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\" \/>\n<meta property=\"og:site_name\" content=\"LaraPush Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-27T04:38:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ritesh Das\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ritesh Das\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\"},\"author\":{\"name\":\"Ritesh Das\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\"},\"headline\":\"How Do You Handle the pushsubscriptionchange Event in Web Push?\",\"datePublished\":\"2026-11-27T04:38:04+00:00\",\"dateModified\":\"2026-11-27T04:38:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\"},\"wordCount\":1308,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg\",\"articleSection\":[\"How to\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\",\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\",\"name\":\"How Do You Handle the pushsubscriptionchange Event in Web Push?\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg\",\"datePublished\":\"2026-11-27T04:38:04+00:00\",\"dateModified\":\"2026-11-27T04:38:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000\"},{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111\"},{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222\"},{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333\"},{\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Illustration of the pushsubscriptionchange event, a service worker swapping an old subscription card for a new one in a database\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/larapush.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How Do You Handle the pushsubscriptionchange Event in Web Push?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/larapush.com\/blog\/#website\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"name\":\"LaraPush Blog\",\"description\":\"Stay Ahead, Stay Notified with LaraPush!\",\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/larapush.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/larapush.com\/blog\/#organization\",\"name\":\"LaraPush\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"width\":280,\"height\":60,\"caption\":\"LaraPush\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd\",\"name\":\"Ritesh Das\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g\",\"caption\":\"Ritesh Das\"},\"url\":\"https:\/\/larapush.com\/blog\/author\/riteshdas\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000\",\"position\":1,\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000\",\"name\":\"Does pushsubscriptionchange fire when a user blocks notifications?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Don't count on it. Behaviour varies by browser, and your handler can't subscribe again without permission anyway. Your server reliably finds out when the push service returns 404 or 410 on the next send. Delete the subscription at that point. If the visitor allows notifications again later, your page-load check creates and saves a new subscription.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111\",\"position\":2,\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111\",\"name\":\"How can I test the pushsubscriptionchange event?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Testing is awkward, because you can't make most browsers rotate a subscription on demand. A practical approach is to extract the handler body into a function, then call it from the page or DevTools console with a fake old endpoint. Check that your server swaps the row correctly and keeps the subscriber's segments.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222\",\"position\":3,\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222\",\"name\":\"Why is newSubscription null in my handler?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Some browsers, and older versions of others, fire the event without a new subscription. They expect your service worker to call pushManager.subscribe() again. Do that with the same VAPID public key, then send the result to your server. If subscribing fails, permission is probably gone, so stop there.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333\",\"position\":4,\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333\",\"name\":\"Should I delete the old endpoint right away?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, once your server has saved the new subscription. Replace the old row instead of inserting a second one, so the subscriber doesn't get duplicate notifications and your counts stay accurate. If you can't match the old endpoint, the 404 or 410 cleanup on the next send removes it.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444\",\"position\":5,\"url\":\"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444\",\"name\":\"Does Firebase Cloud Messaging handle subscription changes for me?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Partly. The Firebase JavaScript SDK refreshes its registration token from the page, and your code should send the latest token to your server whenever getToken() returns it. If you use FCM through your own service worker, keep the page-load re-sync in place so token changes still reach your database.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How Do You Handle the pushsubscriptionchange Event in Web Push?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/","og_locale":"en_US","og_type":"article","og_title":"How Do You Handle the pushsubscriptionchange Event in Web Push?","og_description":"The pushsubscriptionchange event fires when a browser renews or loses a push subscription. Browser support, a handler, and a page-load re-sync.","og_url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/","og_site_name":"LaraPush Blog","article_published_time":"2026-11-27T04:38:04+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg","type":"image\/jpeg"}],"author":"Ritesh Das","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ritesh Das","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#article","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/"},"author":{"name":"Ritesh Das","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd"},"headline":"How Do You Handle the pushsubscriptionchange Event in Web Push?","datePublished":"2026-11-27T04:38:04+00:00","dateModified":"2026-11-27T04:38:04+00:00","mainEntityOfPage":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/"},"wordCount":1308,"commentCount":0,"publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"image":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg","articleSection":["How to"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/","url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/","name":"How Do You Handle the pushsubscriptionchange Event in Web Push?","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage"},"image":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg","datePublished":"2026-11-27T04:38:04+00:00","dateModified":"2026-11-27T04:38:04+00:00","breadcrumb":{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000"},{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111"},{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222"},{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333"},{"@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#primaryimage","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2026\/11\/pushsubscriptionchange-event.jpg","width":1200,"height":675,"caption":"Illustration of the pushsubscriptionchange event, a service worker swapping an old subscription card for a new one in a database"},{"@type":"BreadcrumbList","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/larapush.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How Do You Handle the pushsubscriptionchange Event in Web Push?"}]},{"@type":"WebSite","@id":"https:\/\/larapush.com\/blog\/#website","url":"https:\/\/larapush.com\/blog\/","name":"LaraPush Blog","description":"Stay Ahead, Stay Notified with LaraPush!","publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/larapush.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/larapush.com\/blog\/#organization","name":"LaraPush","url":"https:\/\/larapush.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","width":280,"height":60,"caption":"LaraPush"},"image":{"@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/4f23894f98426ea3a6bd617e59f03bbd","name":"Ritesh Das","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1bd7bb0ba68e36b218587b72e89e511f?s=96&d=mm&r=g","caption":"Ritesh Das"},"url":"https:\/\/larapush.com\/blog\/author\/riteshdas\/"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000","position":1,"url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236000000","name":"Does pushsubscriptionchange fire when a user blocks notifications?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Don't count on it. Behaviour varies by browser, and your handler can't subscribe again without permission anyway. Your server reliably finds out when the push service returns 404 or 410 on the next send. Delete the subscription at that point. If the visitor allows notifications again later, your page-load check creates and saves a new subscription.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111","position":2,"url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236001111","name":"How can I test the pushsubscriptionchange event?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Testing is awkward, because you can't make most browsers rotate a subscription on demand. A practical approach is to extract the handler body into a function, then call it from the page or DevTools console with a fake old endpoint. Check that your server swaps the row correctly and keeps the subscriber's segments.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222","position":3,"url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236002222","name":"Why is newSubscription null in my handler?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Some browsers, and older versions of others, fire the event without a new subscription. They expect your service worker to call pushManager.subscribe() again. Do that with the same VAPID public key, then send the result to your server. If subscribing fails, permission is probably gone, so stop there.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333","position":4,"url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236003333","name":"Should I delete the old endpoint right away?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, once your server has saved the new subscription. Replace the old row instead of inserting a second one, so the subscriber doesn't get duplicate notifications and your counts stay accurate. If you can't match the old endpoint, the 404 or 410 cleanup on the next send removes it.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444","position":5,"url":"https:\/\/larapush.com\/blog\/pushsubscriptionchange-event\/#faq-question-1764236004444","name":"Does Firebase Cloud Messaging handle subscription changes for me?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Partly. The Firebase JavaScript SDK refreshes its registration token from the page, and your code should send the latest token to your server whenever getToken() returns it. If you use FCM through your own service worker, keep the page-load re-sync in place so token changes still reach your database.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3589"}],"collection":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/comments?post=3589"}],"version-history":[{"count":1,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3589\/revisions"}],"predecessor-version":[{"id":3598,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/3589\/revisions\/3598"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media\/3597"}],"wp:attachment":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media?parent=3589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/categories?post=3589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/tags?post=3589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}