Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Detected multiple handlers for 'APP_UNINSTALLED'

Detected multiple handlers for 'APP_UNINSTALLED'

Girish_Rajwani
Shopify Partner
87 3 8

Hi Guys,

 

I madeAPP_UNINSTALLED webhook handler & wrote some code in but it seems APP_UNINSTALLED webhook handler is already there in Shopify node JS template but i am not able to find. I searched the whole directory

 

any help would be really appreciated. 

 

Thanks in advance 🙂

Girish | Shopify Expert  
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - My Shopify Apps: App Store | Looking for a solution to a problem in your store? Send me an email

Replies 3 (3)

chriscoyne
Shopify Partner
7 0 2

Hey did you get an answer to this? I have the same question.

mannenson
Shopify Partner
20 1 10

Bump, also wondering same.

chriscoyne
Shopify Partner
7 0 2

Hey I actually found out the answer to this - if you are using the latest Shopify Node template then it registers a APP_UNINSTALLED automatically webhook automatically for you. Checkout the file below: you see that deleteAppInstallationHandler is the callback, which under the hood deletes the app session from the db for you.

 

https://github.com/Shopify/shopify-app-js/blob/24bcdf91d7f93e552cdbc0163bda573b222ba971/packages/sho...

 

Unfortunately, I don't think there is a way to use an interface and edit this functionality. For me, this is enough because I have a simple app, but I imagine a lot of people probably have more they want to do on an app uninstall. I think the second part of the warning is important though - which is that webhook_handlers are called sequentially. So I ~think~ that if you add another webhook handler, both should function on an app uninstall. Hope that helps.