Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
86 stars 9 forks source link

shopify.toast is undefined when load url to ui-modal src #361

Closed dangngocan closed 3 months ago

dangngocan commented 4 months ago

Hi.

I'm having a problem about "shopify.toast" when loading on ui-modal src.

I'm making a page with shopify bridge so I want to display the message with "shopify.toast". When I load the page without iframe ui-modal, "shopify.toast" is working. But when I load the page to src of ui-modal, the "shopify.toast" is undefined. I don't know why? Anyone has a problem like me? Please help me to resolve the problem?

dangngocan commented 4 months ago

When we load the url on browser tab, "shopify.toast" is defined. unnamed (2)

But, when we load the url to ui-modal (shopify bridge) by "src" attribute: "shopify.toast" is not defined unnamed (3)

dangngocan commented 4 months ago

Does anyone know to resolve the problem? Please help me

zeyios commented 4 months ago

I have the same issue. The global fetch is not authenticated in the max modal with src, so I can't perform fetch operations within the modal.

zeyios commented 4 months ago

This is helpful https://github.com/Shopify/shopify-app-bridge/issues/315

dangngocan commented 3 months ago

This is helpful #315

Thanks @zeyios . It's greate. I can do well