Get shop url during app installation

Solved
Highlighted
Tourist
7 0 3

How can I get the shop url during app installation? During shopify app installation from shopify app store, they are asking to enter the shopify store url in a form like shown below.

Screenshot_2019-07-23.png

 

How can I develop a similar form for my app installation. 

1 Like
Highlighted
Shopify Partner
1777 211 370

Unless I misunderstood your question, you get the shopID in the install URL when the merchant installs your app.

 

This is the default form merchant get when installing the app and not logged in. You cannot have custom intermediary login pages as per OAuth requirements. On a side note, why would you need that?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Highlighted
Tourist
7 0 3

@Visely-Team How can I get the shopID during installation. Currently when I'm developing the app, I'm installing app by directly providing my store url in the install url in my server which does the oAuth process and all. 

0 Likes
Highlighted
Shopify Partner
1777 211 370

This is an accepted solution.

Once you publish the app on the Shopify app store all users will get this screen and Shopify will redirect to the installation URL you provide in app setup passing the storeID. You don't have to do anything extra.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Highlighted
Tourist
7 0 3

@Visely-Team So you mean if my install file is like https://mydomain.com/install.php then during app installation shopify will pass the shop parameter like https://mydomain.com/install.php?shop=mydomain.myshopify.com

1 Like
Highlighted
Pathfinder
126 11 19

Did you ever get an answer? I have the same question about getting the shopOrigin during installation after your app is listed. I know it's appended after OAuth, but for constructing the actual permissionUrl dynamically prior to a merchant installing our app, how do we get it?

0 Likes
Highlighted
Shopify Partner
1777 211 370

shopOrigin is appended to your install URL when a merchant clicks install from the app listing. You get it from the query string and use it to build the callback URL, etc.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Highlighted
Pathfinder
126 11 19

Thank you @Visely-Team. Shopify will also handle the case where the user is not logged in to Shopify and then redirect back to your app's constructed OAuth URL afterward, is that right? 

0 Likes
Highlighted
Shopify Partner
1777 211 370

Yup, that is correct.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like