I'm using FCM on a website built with react and it working as expect only if there are not tabs opened with that website (opening a tab with the url sent from notification body). But if there is a tab with that site the notification will only focus that tab.
How can I change the behavior so that it will ALWAYS open a new tab with specified url?
servicer worker
importScripts("https://www.gstatic.com/firebasejs/9.6.3/firebase-app-compat.js");
importScripts('https://www.gstatic.com/firebasejs/9.6.3/firebase-messaging-compat.js');
const config = {
apiKey: "AIzaSyA6pfbdtbGttzDe6Z41HzPdrPuFoucPm7o",
authDomain: "test-wolves-app.firebaseapp.com",
projectId: "test-wolves-app",
storageBucket: "test-wolves-app.appspot.com",
messagingSenderId: "875146575890",
appId: "1:875146575890:web:b4504731d682606d4618cb",
measurementId: "G-DJKZCCBB0Q"
}
firebase.initializeApp(config);
const messaging = firebase.messaging();
Notification are come as expected. Just that click action behaves differently
Focusing on the existing tab where the app is already open sounds like the expected behavior to me.
There is no way to configure this behavior to be any different, but you may be able to run custom logic in the onMessage and/or onBackgroundMessage functions.