I see a lot of threads in these forums about app/uninstalled webhook not working, but I have not seen any with a solution.
const appUninstallWebhook = async (shop, accessToken) => {
let address = https://${process.env.SHOPIFY_APP_URL}${webhookUrl}
console.log(“–address”,address)
const webhookStatus = await registerWebhook({
address: address,
topic: “APP_UNINSTALLED”,
accessToken,
shop,
apiVersion: ApiVersion.July21,
});
webhookStatus.success
? console.log(--> Successfully registered uninstall webhook! for ${shop},webhookStatus.success)
: console.log(
“–> Failed to register uninstall webhook”,
webhookStatus.result.data.webhookSubscriptionCreate.userErrors
);
};