Is there any way to detect app is getting uninstalled before uninstalling ?

I am creating app for shopify. I went to many sites in search for this. Till now I have came accross app/uninstalled hook but this is called after app is uninstalled. But I don’t want that. I want to get notified just before uninstall.

Anyone can help me out with this ?

Currently there is no way.

@shreyshah , This can not be tracked, since the user can directly delete the app from Shopify Admin without even logging into the app, so it can never be tracked.

I understand that you don’t want webhook for uninstallation, but you can use to it quickly track and act in this case.

Hi … Did you ever get an answer to your quandary? I am building the uninstall feature for my (new) app.

A merchant taps my button to say “uninstall this app” …

First, I will do some metafield (etc) cleanup to his store, then want to do the actual uninstall. I see some references to how to do this using the rest API, such as https://shopify.dev/docs/apps/build/authentication-authorization/app-installation/uninstall-app-api-request, but that API is going away soon, so would not be a brilliant choice … right?

How can I do the actual uninstall by another API?

Thanks! jb