App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I'm creating an embedded app. I have a list of products that are linked to my app.
In my app I want to be able to redirect the user to the edit page of the product when they click on it.
How can I do this?
Yes.
You can use Redirect action.
import {useNavigate} from '@shopify/app-bridge-react';
function MyComponent {
const navigate = useNavigate();
return (
<Link onClick={() => {
navigate({
name: 'Product',
resource: {
id: '123',
}
});
}}>Deluxe collection</Link>
);
}
Thanks for your reply.
Now I'm stuck adding app bridge to my embedded app.
The Provider needs an app bridge config object.
I'm having a hard time to fill in the host in this object.
In the documentation it states:
host: new URLSearchParams(location.search).get("host"),
But location or window.location is not defined in my embedded app.
Do you know another way to get the host? I searched and searched but I didn't found an answer 😞
Is this code helpful for you?