I have a question about reinstalling the test app for shopify app development.

Solved
shira1
Excursionist
50 0 7

*The image is in Japanese.

I am developing a public app and installing the app for testing by following the steps below.
1. On the Shopify partners App Management screen, select the Select Store button under Test App
2. On the [Test App in Development Store] screen, select [Install App](*1)
3. Install by installing the store

*1

Install.jpg

With this installation method, I was able to install it for the first time, but I deleted it by store management (*2)
*2
Uninstall.jpg

After deleting the app, if you install it by the above methods 1 to 3, the message "There is no page at this address" is displayed and you cannot install it. (*3)
*3 
Install_error.jpg

Do I need to reinstall it in another way?
I would appreciate it if you could teach me how to reinstall.

Accepted Solution (1)

Accepted Solutions
sillycube
Shopify Partner
552 14 86

This is an accepted solution.

After you delete the app, a webhook will be sent to the app. The app will clear the user data or mark user status as inactive. It's the app developer's responsibility to handle the app/uninstall webhook. 

If you didn't handle the webhook, you probably cannot reinstall the app again. There may be an error in your user database. You should check your log to see what happened

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview

View solution in original post

Replies 7 (7)
sillycube
Shopify Partner
552 14 86

This is an accepted solution.

After you delete the app, a webhook will be sent to the app. The app will clear the user data or mark user status as inactive. It's the app developer's responsibility to handle the app/uninstall webhook. 

If you didn't handle the webhook, you probably cannot reinstall the app again. There may be an error in your user database. You should check your log to see what happened

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview

View solution in original post

shira1
Excursionist
50 0 7

Thank you for your answer.
I was able to reinstall by clearing the user.

policenauts
Trailblazer
190 9 49

An uninstall webhook is one way, but there is a risk of it failing app submission due to timing during immediate reinstallation. Whenever a shop hits your app, a more fool-proof way is to actually do a GET request to the 'shop' endpoint using the store's access token that you keep in your db and also checking their charge ID. When they uninstall the app, their access token immediately becomes invalid.

If the access token is missing or invalid, show OAuth. 

If access token is valid but they don't have a valid charge ID, it means they installed the app but didn't accept your billing - show the billing screen.

If both are valid, you can welcome them back to the app. 

sillycube
Shopify Partner
552 14 86

Thanks for your explanation @policenauts 

How to check if the access token is valid, just catch the UnauthorizedAccess exception?

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
policenauts
Trailblazer
190 9 49

You do an http GET request to that shop's 'metafields' API endpoint and if you get a 200 OK code, that means your access token is valid, but if you get an error 500, it means the access token isn't valid. 

sillycube
Shopify Partner
552 14 86

Thanks @policenauts 

I try to catch UnauthorizedAccess and redirect users to the plan page. Now it should be ok. Just need to tidy up redundant codes about redirecting to the plans

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
shaurdav
New Member
4 0 0

I had a similar problem, although it was solved by itself after restarting the computer. So I probably won't be able to help. But I'm still interested in finding out. What kind of application do you have in general and why is everything in it in Japanese? By profession, I am engaged in application development, so it is always good for me to learn something new. Although recently, for some reason, there are very few orders. Most likely, this is due to the fact that there are now many more developers. It's a pity that there are no more services for testing applications. Well at least such high-quality services as for example https://www.qacoverage.com/ at the moment, not so much really. Although probably if you search well on the Internet, you can find anything.