What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: A few questions about APP_UNINSTALLED webhook

Solved

A few questions about APP_UNINSTALLED webhook

DarkStar1
Shopify Partner
6 0 0

Hi, I'm trying my hand at subscribing to the APP_UNINSTALLED webhook and I have a few questions for you Shopify experts.

 

Are the apps already listening to this webhook by default or did I activate it without realizing it? I was doing some webook activation tests and it did not give me any error in the response, but only null (undefined) if printed with console.log. I tried uninstalling the app, and the webhook worked fine. So was it me or do apps listen to this webhook by default?

 

The second question is this: If I uninstall the app and previously created a subscription to a webhook, does this subscription need to be recreated if the app is reinstalled or remains active?

 

Sorry if I was too long-winded, thanks in advance.

Accepted Solution (1)
loganaa
Shopify Partner
12 1 0

This is an accepted solution.

hello

1, yes, after app/uninstalled wehook is created, any uninstalled application will be notified to the address(the interface address defined when you create the webhook).

 

Webhook subscriptions won't automatically canceled when the app is uninstalled, it's still there, they're already active, unless you call "Remove an existing Webhook".

 

The above is only for app/uninstalled Webhooks, I only used this one.

 

I'm using the rest api, but I think they're pretty much the same

捕获.PNG

 

View solution in original post

Replies 3 (3)

loganaa
Shopify Partner
12 1 0

Hi, I'm a developer

On your first question, I'm not sure what you mean, if you create an uninstall webhook, when the store uninstalls the app, the webhook will call your endpoint.

 

With regard to your second question, there is no need to recreate. If created repeatedly, shopify will report an error :"for this topic has already been taken". The way we handle this is to catch the exception and leave it alone

DarkStar1
Shopify Partner
6 0 0

Hi @loganaa , thanks for your reply. I probably explained myself wrong, the questions are the following:

 

  1. Do applications listen to the APP_UNINSTALLED webhook by default without having to invoke the GraphQL API to subscribe to the webhook?
  2. Are webhook subscriptions automatically canceled when the app is uninstalled? If the same previously uninstalled app is reinstalled, do I have to subscribe the app to the necessary webhooks or are they already active?

Thanks in advance

loganaa
Shopify Partner
12 1 0

This is an accepted solution.

hello

1, yes, after app/uninstalled wehook is created, any uninstalled application will be notified to the address(the interface address defined when you create the webhook).

 

Webhook subscriptions won't automatically canceled when the app is uninstalled, it's still there, they're already active, unless you call "Remove an existing Webhook".

 

The above is only for app/uninstalled Webhooks, I only used this one.

 

I'm using the rest api, but I think they're pretty much the same

捕获.PNG