Victor Jeman Academy

How do I reach the user after they close the tab?

Web Push and the Notifications API can reach a closed tab, but only with explicit permission and a service worker behind them.

Push reaches a closed tab

A toast only works while the tab is open. Once the user leaves, you need Web Push plus the Notifications API, both running through a service worker that stays alive in the background even when no tab is open.

For [feature], do I actually need to reach the user when no tab is open, or is an in-app notification enough while they are on the page?

Ask for permission at the right moment

There is no push without explicit permission. Ask on page load and the user denies it, which burns the prompt for good. Ask in context instead, right after they do something that makes notifications obviously useful.

At which exact moment in my flow should I request notification permission for [feature] so the value is obvious to the user, instead of prompting on page load?

Push needs a service worker and explicit permission. Ask for it once the user has seen why it helps, not on page load.

Additional Resources

Explore these carefully curated resources to deepen your understanding and practice the concepts covered in this lesson.