No host parameter for App Bridge in the URL of the app link

No host parameter for App Bridge in the URL of the app link

nemmy
Shopify Partner
6 0 0

I am trying to update my app to App Bridge 3.0 following the instructions in the following notification:
https://shopify.dev/docs/api/app-bridge/previous-versions/updating-overview?locale=ja#update-your-ap...

 

When I access the app with the following URL:
https://???.myshopify.com/admin/apps/hello-139/top

 

I can retrieve the host parameter from the URL and initialize App Bridge using the following code:

new URL(window.location.href).searchParams.get("host");

 

However, when I click the link for the app name in the lower left corner of the store (see the image), the URL is as follows, and the host parameter becomes null, resulting in the following error:
https://???.myshopify.com/admin/apps/hello-139?appLoadId=???

 

shopify.png

 

AppBridgeError APP::ERROR::INVALID_CONFIG: not a valid host, please use the value provided by Shopify

 

Why is this happening? How can I resolve it?

Replies 0 (0)