How to avoid 404 page when merchant editing the marketing activity but the App had been uninstalled

Highlighted
Shopify Partner
6 0 0

Hi, masters,

 

I would like to know the solution to the problem here: https://community.shopify.com/c/Shopify-APIs-SDKs/How-to-avoid-404-page-when-merchant-editing-the-ma...

 

Hi, masters,


I created an extension for my APP, the shop owner is able to create marketing activity based on my APP.

 

If the activity was created, then the shop owner uninstalled my app, the activity still in their marketing campaign.

 

When the shop owner clicks this activity, it would show the page like this:

 


Screen Shot 2019-12-02 at 1.19.42 PM.png404 not found

I expected that would show the page like this, it contained the banner with the notification message telling the shop owner to install the app before using the activity. 

 


Screen Shot 2019-12-02 at 1.19.34 PM.pngShow the notification

We tried to update the marketing status into PAUSED or DISCONNECTED, but I got access token invalid error instead. I think once the merchant uninstalled the app, the access token became invalid right away.

 

We also tried the solution in the replies. First, we used the `errors` parameters in MarketingActivityUpdate and updated the status into DISCONNECTED (like the screenshot below), but it will show the error messages forever, not just after the app is uninstalled.

Besides, according to the developer document, the status should be changed into DISCONNECTED automatically by Shopify as soon as the merchant uninstalls the app in admin page.

Screen Shot 2020-01-06 at 2.07.23 PM.png

 

And clicking the activity still gets the 404 not found page:

Screen Shot 2020-01-06 at 2.07.34 PM.png

 

How can I avoid not found page and show the warning banner (like the one in the original post)?

 

Thanks. : )

Vincent

 

0 Likes