Hi everyone,
We’re migrating from legacy App bridge v3 Redirect actions to the new APIs shown in the Shopify’s App Bridge migration guide, specially:
shopify.navigation.navigate(“/settings.html”);`
However, in our embedded Shopify Admin app, shopify.navigation.navigate is not available/undefined, even though window.shopify exists and other APIs work.
Our setup:
We are loading the new Shopify CDN App bridge runtime:
<script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
Our app runs embedded inside Shopify Admin
What works?
These APIs work and are available in the window.shopify context:
- window.shopify.toast
- window.shopify.loading
- window.shopify.modal
- window.shopify.config
- window.shopify.idToken()
and other APIs except - window.shopify.navigation
window.shopify also prints a valid object and shows:
origin: “https://admin.shopify.com”- other config/app/environment values
But we cannot use:
shopify.navigation.navigate(“path”);
What we want to achieve:
We want to remove legacy App bridge v3 completely and avoid browser redirects like:
window.openwindow.location.href
because these can cause issues inside the Shopify Mobile Admin App (Not sure if it would but better safe than sorry)
We only want to use Shopify-native embedded navigation.
Questions:
- Is
shopify.navigation.navigate()supposed to be available for all embedded apps using the new CDN script? - Are there an requirements for this API to be injected (admin surface, app type, permission, initialization steps etc)?
- If
shopify.navigation.navigate()is not available, what is the recommended Shopify-native navigation approach (that works in Shopify Mobile Admin too)?
Thanks in advance!!