FROM CACHE - en_header

Detecting if a specific app in installed via liquid

Andrew93
Shopify Partner
98 0 20

Hello,

I am trying to figure out if a specific app in installed or not in liquid in order to provide access to the app proxy pages from within the theme only if an app is installed.

Ideally we would be able to check if an app is installed via something like {{ shop.apps.APP_NAME }}.  I have tried setting this up by having my app add a metafield to the shop, however it is not possible to remove this metafield on uninstall since I no longer have access to metafields after uninstall.

Does anyone have anyway of detecting if an app is installed from within the liquid content in a theme?

Thank you,

-Andrew

Replies 6 (6)
HunkyBill
Shopify Expert
4769 54 555

A correct implementation of App Proxy usage implies you do not allow any incoming calls to the App Proxy if the App is not installed (unless you choose to serve all comers). Since all App Proxy calls include the shop details presenting the request to your Proxy, you can simply ignore calls to this App Proxy that are coming from a shop without the App installed. 

No need to mess around as you are asking. 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Andrew93
Shopify Partner
98 0 20

Hey HunkyBill,

Unfortunately I am not trying to detect this from an app proxy but instead use this in a theme to provide a link to an app proxy page(from a normal page) if the app containing the proxy is installed.

For example I would like to provide a link within the product.liquid template to an app proxy page related to this product but only if the app providing the proxy page is installed in the shop

HunkyBill
Shopify Expert
4769 54 555

Provide the link to anyone.. anytime... it does not hurt. Whenever a call comes in you do not want to service, send back nothing... 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Gavinator
Shopify Partner
1301 10 112

Hi Andrew,

Have you thought about having your App install a script tag? The script will be called only when the App is installed.

Gavin.

www.bookthatapp.com
Chris_Chimen
New Member
5 0 0

Have you got any ideas @Andrew

Freelance Shopify Developer. Contact me: chris@chimen.co
HunkyBill
Shopify Expert
4769 54 555

@chris. 2 perfect solutions presented here. What more could you want?

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com