mo-ah-dawood / fcm_config

10 stars 12 forks source link

[HELP] How to make the browser switch to the app tab when the notification is clicked? #14

Closed ReniDelonzek closed 2 years ago

ReniDelonzek commented 3 years ago

As expected, notifications only appear when the user does not have the app tab open. However, when the user clicks on the notification, the browser is expected to switch from tab to app tab, but it doesn't

ReniDelonzek commented 3 years ago

I managed to solve this server-side with

webpush: {
      fcmOptions: {
             link: 'https://www.example.com/',
      },
},

I'll leave that open for a possible client-side solution

mo-ah-dawood commented 3 years ago

try to use this

in sw file