You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just tested without SSR - same error occurs. ServiceWorker registration fails in Facebook/Instagram in-app browser on iOS, causing the app to break. This suggests the issue is with in-app browser's ServiceWorker API support rather than SSR implementation.
For clarification, is the invocation of navigator.serviceWorker.addEventListener failing or is it the code placed inside the event listener that causes the failure? addEventListener is a function implemented by the browser. If invoking it fails then it appears that the Facebook in-app browser doesn't support service workers.
It's a best practice to gate your service worker registration by calling the isSupported() method in provided by the Messaging SDK, if you're not already. It checks for the elements of the browser that Messaging would require, including if the browser supports service workers.
import { isSupported } from "firebase/messaging";
if(isSupported()) {
// configure & use messaging
}
Uh oh!
There was an error while loading. Please reload this page.
Operating System
iOS (all versions)
Environment (if applicable)
Facebook/Instagram in-app browser on iOS
Firebase SDK Version
11.4.0 (latest)
Firebase SDK Product(s)
Messaging
Project Tooling
Detailed Problem Description
When initializing Firebase Cloud Messaging in an Angular SSR application, multiple critical issues occur:
The service worker registration fails specifically in the Facebook/Instagram in-app browser on iOS with the error:
The issue only occurs in the Facebook/Instagram in-app browser on iOS. Regular Safari and other mobile browsers work as expected.
Steps and code to reproduce issue
The text was updated successfully, but these errors were encountered: