Shopify / shopify-app-template-php

274 stars 88 forks source link

How to run non embeded app #419

Open anurag3386 opened 1 year ago

anurag3386 commented 1 year ago

I am trying to setup non embedded app with the help shopify cli3 using php template. I have disabled embedded app from the shopify section but app still not working as non embedded. Please help what change we need to do at script level under the laravel.

shahzadwaris commented 1 year ago

@anurag3386 Did you find out any solution for this? I'm also facing the same issue.

shahzadwaris commented 1 year ago

Okay, I found the solution.

  1. Log in to your Partner account and select your app.
  2. Click on App Setup from the left sidebar and scroll to the bottom. 3) Embedded app: Click on manage and turn it off. 4) Modify the code in AppServiceProvider.php Context::initialize( env('SHOPIFY_API_KEY', 'not_defined'), env('SHOPIFY_API_SECRET', 'not_defined'), env('SCOPES', 'not_defined'), $host, new DbSessionStorage(), ApiVersion::LATEST, false, false, null, '', null, (array)$customDomain, ); An extra step would be changing the redirect URL in /api/auth/callback route to your customer route. This is done.
anurag3386 commented 1 year ago

Hello @shahzadwaris

I already fixed the same after lots reading the steps in code and do the same thing.

Thanks Anurag

ellowwwteam commented 1 year ago

@shahzadwaris I'm Modify the code in AppServiceProvider.php. Also, changed the custom route URL for in "/api/auth/callback" redirect. But, It's continuously refresh page and not redirecting to custom route URL.

shahzadwaris commented 1 year ago

@ellowwwteam did you add the HOST with your custom domain in the .env file?

ellowwwteam commented 1 year ago

@shahzadwaris Yes, I have update the host in .env file. Any other changes need fixing the non embedded app?

khanakia commented 11 months ago

App is continuously refreshing and redirecting again and again after i made it Non Embeddable

shahzadwaris commented 11 months ago

Did you follow the above instructions?

khanakia commented 11 months ago

Yes, i found my App Setup was set to Add Embed usually that does not happen when you create a new app.

sk29110 commented 7 months ago

I started working on the none embeded app. Call to a member function send() on null. @shahzadwaris you are very confident about this can work as none embeded app. How do you do the last step?

An extra step would be changing the redirect URL in /api/auth/callback route to your customer route. This is done.

shahzadwaris commented 7 months ago

@sk29110 Can you please show me the error or exception page?

sk29110 commented 7 months ago

Just to make it clear I made another app then the following changes

  1. Set "You app is not embedded" in Shopify Admin
  2. Update AppServiceProvider so $isEmbeddedApp = false Then when I click on the app link it does show up in another tab but with this error message @shopify/cli/3.52.0 darwin-arm64 node-v21.5.0 npm-10.2.4 image
sk29110 commented 7 months ago

Any idea? @shahzadwaris

kamalsharma9392 commented 4 months ago

Hey @sk29110 & @shahzadwaris , did you guys able to solve this issue, I am also facing the same issue

sushansht commented 1 month ago

I did the following steps and it worked:

  1. From partner in app setup change embedded to false

  2. In AppServiceProvider.php, set host to url of the your app like 'https://example .com", set custom domain to ["example.com"] where example.com is your app url, set is embeded to false and run config cache. You can set these value from env too.

  3. In appbrideprovider.js change force redirect to false.

Then it should work as expected.

pramod-praella commented 1 month ago

@sushansht I followed the same but facing this issue. image