If I understand correctly, going to http://myshopify.com/admin/api/auth?api_key=<api_key> is basically the same as if the merchant went to the app store and click 'Install' for the app matching the api key in the url. Right?
This is great because it allows to share a url to trigger the installation of the app.
The way it seems to work is that this url is redirected by shopify to the app url, and it's up to the app's page logic to implement the oauth flow.
Is there a way to somehow pass query parameters to that url, such that they are forwarded to the app url? Quick testing seems to indicate that query parameters are not forwarded.
I'm trying to achieve a kind of deep linking, where I want to pass the specific app url that the user should be presented with once the application is installed.
Is this possible?
You can just embed parameters within the URL (host/path) itself, pather than as query params. E.g. https://[param].myapp.com or https://myapp.com/[param1]/[param2]/
Hmm. Can you just trigger the install from your end, rather than passing the client to the Shopify app page? e.g. if you're using a standard oauth setup, you might go to a URL like:
https://myapp.com/auth/shopify?shop=[a-shop].myshopify.com
So whatever custom params you need you can just manage on your end, store in session/DB and then initiate the oauth install process (you can even then send them through the standard app store install process, as long as your server is able to match-up the account as they get sent back in)
Thanks for your suggestion.
One issue is that when a merchant clicks a link like https://myapp.com/[param1]/[param2]/, this will not pass in the shopid to my app. This is why http://myshopify.com/admin/api/auth?api_key=<api_key> is useful.
The session/db/cookie solution could be cobbled together but I'm really trying to avoid any state hanging around like this, as it's not very reliable/clean.
I will probably have to hack something like that, but it would be a lot cleaner if there was a way of passing parameters directly in the oauth app url...
User | Count |
---|---|
14 | |
8 | |
8 | |
7 | |
6 |