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

chenster
Pathfinder
89 3 7

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.

Try the free Sales Popup Maker
0 Likes

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
chenster
Pathfinder
89 3 7
0 Likes
marcusradica
Shopify Staff
Shopify Staff
41 5 6

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

marcusradica | Developer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

chenster
Pathfinder
89 3 7

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!
Try the free Sales Popup Maker
0 Likes
_JB
Shopify Staff
Shopify Staff
823 97 178

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? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
chenster
Pathfinder
89 3 7

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?

 
Try the free Sales Popup Maker
0 Likes
_JB
Shopify Staff
Shopify Staff
823 97 178

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? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
ovidiucaramida
Excursionist
11 0 4

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

policenauts
Trailblazer
170 8 29

You should not be depending on Shopify uninstall webhook to tell you if a store's status. What I do is I send an API request using the store's access token to the metafields endpoint, and if it comes back as unauthorized then I know I should route them to OAuth.

0 Likes