javascript - Private embedded shopify app -


i'm trying build embedded private app , i'm missing. instructed here, created app, got api key. simple page content:

<head>   <script src="https://cdn.shopify.com/s/assets/external/app.js"></script>   <script type="text/javascript">     shopifyapp.init({       apikey: 'my-private-api-key',       shoporigin: 'https://my-dev-shop.myshopify.com',       debug: true     });   </script> </head> <body> private app </body> 

and i'll visiting page redirect shop screen.

the page you're looking can't found. try search instead. 

redirect url is

https://my-dev-shop.myshopify.com/admin/apps/my-private-api-key/  

what missing? it's first experience shopify @ all, maybe missing understanding how easdk works. tested localhost , domain ssl. thank tips.

i pay more attention embedded apps , tell more experience , problems met before managed create , install private app.

embedded apps allows modify , feel of admin part of shopify. there no special app type called "embedded apps" in shopify. app creator can enable "embedded app" sdk when creates regular "public" app in partners account. if feature enabled - app can use embedded app sdk in store's admin.

my problem realize how install embedded app store , how make private i.e available stores without publishing app store. answer is:

  • we need create regular public app "embedded app sdk" enabled (using partners account)
  • we not need publish store (so no-one excepting know it)
  • we need install in store's admin.

last action means need described regular public shopify apps i.e allow app access store using oauth handshake. procedure described here.

let me repeat points:

  1. send request https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}. replace {strings in curly braces} appropriate values. note {redirect_uri} must 1 of redirection url specified in app settings, {scopes} should replaced 1 of allowed scopes here (i used first scope, not important me, did not want modify data, wanted t use embedded app sdk ui methods).
  2. in result send example.org/some/redirect/uri?code={authorization_code}&hmac=da9d83c171400a41f8db91a950508985&timestamp=1409617544&state={nonce}&shop={hostname} (example.org/some/redirect/uri redirect_url pointed in first request) , expect query handled on side.
  3. "properly handled" means post request sent https://{shop}.myshopify.com/admin/oauth/access_token , have following fields:
    • client_id - api key app
    • client_secret - shared secret app
    • code - {authorization_code} came query.

i did not need backend stuff created simple html form necessary fields , submitted (method=post, action=https://{shop}.myshopify.com/admin/oauth/access_token) , received json access token.

after in admin of store in apps section must see link added app. after clicking on here try open load iframe src equal application url of app. url must point app i.e html can want. people want use sdk methods. please note possible http/https issues


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -