How long does it take to trigger 'app/uninstalled' webhook so that the app can be removed?

Highlighted
Excursionist
36 3 3

For a successfully registered webhook, specifically, 'app/uninstalled', how long would it take for the webhook to fire? It doesn't seem it immediately fires. I tried many time and it never fired.

https://cuedd.com
0 Likes
Highlighted
Excursionist
38 1 8

Hi,

Do you mean the shop/redact webhook? If so, it is invoked 48 hours after app uninstall. 

shop/redact: 48 hours after a shop uninstalls your app, Shopify will send an HTTP POST request for the shop/redact topic. Upon receipt of the webhook, the app must delete all customers’ personal information associated with that shop.

https://apps.shopify.com/picamaze
Animated watermarks for product images and ads
0 Likes
Highlighted
Excursionist
36 3 3

Thanks, but I'm talking 'app/uninstaled' webhook from https://shopify.dev/tutorials/charging-for-your-app-with-rest-admin-api-bill-for-uninstalls

https://cuedd.com
0 Likes
Highlighted
Shopify Staff
Shopify Staff
14 1 0

Hey there, the 'app/uninstaled' webhook should be firing right after the app is uninstalled 

0 Likes
Highlighted
Excursionist
36 3 3

That still doesn't seem to work for some reason.

Here's my code to register the webhook using php-shopify.

/* register app/uninstalled webhook */
$webhook_data = array('topic'=>'app/uninstalled','address'=>'https://myshopifyapp.com/shopify/uninstall','format'=>'json');
$webhook_create = $shopify->Webhook->post($webhook_data);
 
I verified that it had registered webhook successfully for the store. However, after I removed the app from the test store, it didn't uninstall the app. I have whitelisted the URL for uninstall URL, and turned on debug log, but there's nothing. Very frustrating!
https://cuedd.com
0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 129

Hey @chenster,

What's the name of your app? I'll try installing/uninstalling it and let you know what I see in our logs.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Excursionist
36 3 3

Thanks for getting back to me. It is not yet published. Planning to submit it today. Is it because it is not yet in the Shopify app store?

 
https://cuedd.com
0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 129

App store listing shouldn't affect this. Feel free to PM me an install link, or follow up here once the app is listed.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Tourist
11 0 3

My app registers the app/uninstall webhook when the app is installed and it works, but Shopify takes too long to trigger the webhook when the app is uninstalled.

The webhook gets triggered after at least 2 minutes after the app is deleted. Because of this if someone tries to reinstall the app immediately an error will be triggered because the app didn't get to reset the session for that store.

This causes the app submission to fail with this error: 

During install or reinstall we expected Oauth to be initiated at https://appstoretest5.myshopify.com/admin/oauth/request_grant but was redirected to https://appstoretest5.myshopify.com/admin/apps/b272ce5950aa539392d0d441e0b51311

Is there any solution for this? I am struggling with this for 2 days now

0 Likes