Im building a react app. in the app, Im receiving a message through an API and if I receive a message, the message automatically display to the user.
But the problem is if the user is on another tab, they cannot see whether a message is received. I want to make the react app tab active immediately if the user is browsing on another tab after receiving a message. Is there a way in react to make the tab automatically active?
There is not.
The only solution I can think of is to create a push notification that could display the message to the user even if he is on another tab.
Intro to push notifications here: https://www.studytonight.com/post/javascript-desktopbrowser-push-notification-example