Embedded App Redirect Problem In Shopify Admin Frame

Shopify Partner
1 0 2

I can install the app on a dev store, the app functions are working great once I get into the app but I think it is having issues actually opening the app or post installation - most likely something wrong with my use of App Bridge and redirect uri.


My current flow is as follows ->

abc.com is a app

1. User install app at abc.com/install.php.

2. /install.php builds auth url (similar to this structure https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={...) and redirects user to redirect_uri which is access token generator file.

3. Redirects back to abc.com/install.php -> check if app is installed, if yes then redirect to https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={... where redirect_uri is /index.php.

6. abc.com/index.php opens in a NEW window, not in the iFrame within Shopify Admin.


The flow has a problem is that the app is frequently calling /admin/oauth/authorize frequently (regardless of the app is installed or not) and Shopify has loop detection for this.




The feedback from Shopify after app submission is that the app need to load within an iFrame and not in a window itself. But I am confused about how to redirect the user back to the iFrame or even how to load the app within the iFrame after installation.


I have tried redirecting back to https://{shop}.myshopify.com/admin/apps/<app_name> or https://{shop}.myshopify.com/admin/apps/<app_id> but the UI of the app is not showing up.


I have seen this thread https://community.shopify.com/c/shopify-apps/embedded-app-loading-problem-in-admin-frame/td-p/429421 which having the exact same problem but there is no solution or explanation of the solution for it.

Replies 0 (0)