Shopify Api: check if my app is installed

Hey, since the app base url and the installation url are the same, I check if the shop url exist in my database and if the hmac is valid for authorization.

If url does not exist, the OAuth process (installation) starts.

But when I delete my app and want to reinstall my app, the OAuth process doesn’t start, but I get instantly in the app, because the shop still exist in the database and the application can’t know that this is a fresh install

I know about the webhook for shop deletion (48h is too late)

Is there any other way to find out, if the app is installed in the current shop?

Hi there :waving_hand:

Most of the time you can expect the app/uninstalled webhook to be received right away. Though you are correct, webhook events are not guaranteed to be delivered.
Because of this in it is a common flow when opening the app to make an API call to Shopify if the api key you have stored. If the API call returns 401 unauthorized, then you can infer that your API key has been invalidated, and the Shop has previously uninstalled.