By default, FCM’s onMessage() event handler functions seamlessly when the app is in the foreground. However, it fails to trigger when the app transitions to the background or when the tab becomes inactive. This guide will help you troubleshoot and resolve this common issue.
Read more: Troubleshooting onMessage() Not Firing in Background: A Guide for Web JavaScript Developers enter link description here