Hi there. I’m not sure if this is new, but one of my app users just reached out that the product creation with the “intents” API is not working via the mobile app. It works fine in the browser. You can recreate this in the “react-router” template with this code on the app.additional.tsx page, and then load the additional page and click the button on the browser and in the app. On the browser it loads a new product form, on mobile in the Shopify app it doesn’t do anything, at least for me and apparently my user:
import { useAppBridge } from "@shopify/app-bridge-react";
import { useCallback } from "react";
export default function Demo() {
const shopify = useAppBridge();
const createProduct = useCallback(async () => {
return shopify.intents.invoke!({
action: "create",
type: "shopify/Product",
})
.then((activity) => activity.complete)
.then(async (result) => {
console.log(result);
})
.catch((error) => {
console.error("Error creating product", error);
});
}, [shopify]);
return (
<s-page heading="Additional page">
<s-button onClick={createProduct}>Create product</s-button>
</s-page>
);
}
Copying @Liam-Shopify and @Alan_G, whom I see have helped with support in this category recently.