Send web push notification from an embedded app

How can I send web push notification from my Shopify embedded app ?
I can’t use await Notification.requestPermission() inside my app
It works for non-embedded app

As I know, the parent iframe of my app needs to have the property allow=”notification”?

1 Like

Hey @Cuong_Vu_Manh,

The browser’s Notification API (Notification.requestPermission()) isn’t currently available in embedded apps.

For an alternative approach, you can use App Bridge Toast:


shopify.toast.show('Your message here', {

duration: 5000

});

Toast provides non-disruptive messages at the bottom of the admin interface. It won’t send browser push notifications when the admin isn’t open, but it’s the official notification mechanism for embedded apps.

Can you share more about your use case for browser notifications? I’ll submit this as a feature request with your specific context.

I am developing a feature that sends a notification from my Shopify app to the customer’s browser/device as soon as a product is restocked
(The customer has already subscribed to receive notifications about product restock )