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
I have a use case that I want to refresh the content on the page if the user is not currently using the page. If they are on the page I don't want to interrupt their workflow. The problem is that both the notification click and received go through the same onMessage subscriber.
Looking at the code, I don't see how I can achieve that without abandoning a good portion of Firebase messaging. If we could add some indicator in the onMessage() callback to indicate the source of the message, it would be help in handling the events separately.
Steps to reproduce:
Add callback to Firebase.messaging().onMessage().
Notice that the same code 'attemptToMessageClient_' gets called for both the 'onNotificationClick_' and 'onPush_' in sw-controller.ts. From there, the messaged is handled by the event listener registered in 'setupSWMessageListener_' in window-controller.ts. You can see that the two events call the same messageObserver_ which routes the same to onMessage that the client registers.
Relevant Code:
The text was updated successfully, but these errors were encountered:
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
I have a use case that I want to refresh the content on the page if the user is not currently using the page. If they are on the page I don't want to interrupt their workflow. The problem is that both the notification click and received go through the same onMessage subscriber.
Looking at the code, I don't see how I can achieve that without abandoning a good portion of Firebase messaging. If we could add some indicator in the onMessage() callback to indicate the source of the message, it would be help in handling the events separately.
Steps to reproduce:
Add callback to Firebase.messaging().onMessage().
Notice that the same code 'attemptToMessageClient_' gets called for both the 'onNotificationClick_' and 'onPush_' in sw-controller.ts. From there, the messaged is handled by the event listener registered in 'setupSWMessageListener_' in window-controller.ts. You can see that the two events call the same messageObserver_ which routes the same to onMessage that the client registers.
Relevant Code:
The text was updated successfully, but these errors were encountered: