How to fetch weather the store is in old domain or new domain?

Hello Everyone!

Shopify has updated the Domain structure / URL for the stores and the structure is different for some of the stores, they have changed it to the new domain which is (admin.shopify.com/store/storename) and the old one is (storename.myshopify.com), so after making host parameter changes for the apps, for the old store which is moving to the new URL, for them the apps stop working and hence wanted to know how do we fetch the Old / New Domain details to avoid this kind of a situation where in the app will stop working if the Old merchant has moved to the new URL and Shopify is also making changes frequently that the updates get reverted for some of the stores suddenly and they will again come to us complaining about the apps not working for their store. Hoping to get some help here to get this resolved.

Thank You!