How can I identify if a callback URL is for first-time app installation or reopening?

Hi,

I still don’t quite see how your local host URLs would work (even in testing) as your app URL would have to be exposed to the web in order to load the app into the Shopify dashboard. Anyway, I might be missing something, to answer the rest of your question:

Ok I think I understand what you’re trying to do. I’ve never tried to do this the way you’re describing, so I can’t help you there. Why don’t you just run some code before you create a database entry for the shop? v.rough example:

@shop = ShopifyAPI::Shop.current
if Shop.find_by(shopify_domain: @shop.myshopify_domain)
      #shop already exsists
else
     #some logic here
     @db_shop = Shop.new
     @db_shop.shopify_domain = @shop.myshopify_domain
     #etc
     @db_shop.save
end

Cheers,

Oli

——————————

Founder [email removed] www.preproduct.io

Test and make sales for future products