Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you use EASDK? #24

Open
falesar opened this issue Sep 23, 2016 · 11 comments
Open

how do you use EASDK? #24

falesar opened this issue Sep 23, 2016 · 11 comments

Comments

@falesar
Copy link

falesar commented Sep 23, 2016

i successfully installed my app, but every time i open my app in the admin page, it redirects me to my redirect uri where my app can be found, which is in heroku, anyone got an idea how to put the my app in the iframe instead of getting redirected to heroku? i tried checking EASDK documentation but I still don't get it how to make it work.

https://help.shopify.com/api/sdks/embedded-app-sdk?ref=microapps

@myjanky
Copy link

myjanky commented Sep 23, 2016

Hi @falesar
try this

screenshot 2016-09-23 at 8 33 04 am

@falesar
Copy link
Author

falesar commented Sep 26, 2016

my redirect uri is get_products.php, so should i insert this script in my php file?

<script type='text/javascript'>
  window.top.location.href = "/auth/shopify?shop=myshopname";
</script>

also tried:

<script type='text/javascript'>
  window.top.location.href = "/auth/shopify?shop=<?$_GET('shop')?>";
</script>

but still no luck, it still redirects me to the heroku page

@myjanky
Copy link

myjanky commented Sep 26, 2016

You can not use the /auth/shopify uri if you are not using the ruby gem. This is the phpish app skeleton.

you should use /oauth uri instead....

@falesar
Copy link
Author

falesar commented Sep 27, 2016

i've tried:
window.top.location.href = "http://myshop.com/admin/oauth";
as stated in the documentation, but it says "The page you’re looking for could not be found. Please make sure the web address is correct."
i also tried:
window.top.location.href = "/oauth?shop=";
and
window.top.location.href = "https://$_GET['shop']/admin/oauth";
but they still redirect me to my heroku app and
window.top.location.href = "/oauth?shop=myshop.myshopify.com";
gives me a 404 error

@myjanky
Copy link

myjanky commented Sep 27, 2016

@falesar
Copy link
Author

falesar commented Sep 29, 2016

am i doing this right? i inserted the following codes in my get_products.php

<head>
    <script src="https://cdn.shopify.com/s/assets/external/app.js"></script> 
    <script type="text/javascript">
        ShopifyApp.init({
            apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
            shopOrigin: 'https://mystore.myshopify.com',
            forceRedirect: false
        });
    </script>
</head>

my shopOrigin is my actual shop to check if really works, it still redirects me to heroku even though its forceRedirect is false

@myjanky
Copy link

myjanky commented Sep 29, 2016

I think the forceRedirect needs to be true.

The script detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the Shopify admin. This functionality can be disabled by passing forceRedirect: false as a configuration option.

@falesar
Copy link
Author

falesar commented Sep 30, 2016

okay i tried making it forceRedirect to true, in my default browser, Firefox, it gave me connection errors, so i tried accessing it in Google Chrome, it still redirects me to heroku

@myjanky
Copy link

myjanky commented Sep 30, 2016

@falesar are you using any kind of session management?
The skeleton does not have any kind of sophisticated session management and you need to exchange the temp token with a permanent one

look here and there is some test you can do to see if it is https://www.shopify.com/partners/blog/17056443-how-to-generate-a-shopify-api-token

@raviravikant
Copy link

I am facing same problem as @falesar , but not find any solution for this problem can you please tell me the solution for this ,
Firstly I created an app by this https://www.shopify.com/partners/blog/17056443-how-to-generate-a-shopify-api-token
It worked but after that i tried phpish app skeleton and i successfully installed the app but redirect problem i am facing,
Can you please help me sir.

@myjanky
Copy link

myjanky commented Dec 26, 2017

need a little bit more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants