所以基本上我已经创建了一个应用程序,它的流程就像,

应用网址:https://example.herokuapp.com/installation/install.php

App主页:https://example.herokuapp.com/HomePage.php

(1)安装步骤使用install.php

(2)出现账单屏幕 .

(3)重定向到app HomePage.php

  • 以上步骤正常,但问题现在开始了

♦当我单击Apps / MyawesomeApp时,它将在iframe中为我提供空白屏幕 .

我得到了这个问题 . 这是由install.php发生的,因为它只有安装代码,而不是我的HomePage代码

这就是为什么每当我点击我的应用程序时它会给我一个空白屏幕 . 请给我一个合适的解决方案 . 所以基本上我想要一个逻辑来查找是否在商店中安装了应用程序然后应该将应用程序重定向到登录页面 .

if($DB_shop== $GET_shop)
  {      

     header("location: https://" . $shop . "/admin/apps/example/index.php");
     die;

  }
  else
  {

     $api_key = "xxxxxxxxxxx";
     $scopes = "read_orders,read_products";
     $redirect_uri = "http://example.herokuapp.com/installation/generate_token.php";

     $install_url = "https://" . $shop . "/admin/oauth/authorize?
       client_id=" . $api_key .  "&scope=" . $scopes . "&redirect_uri=" .                                                       
       urlencode($redirect_uri);

     header("Location: " . $install_url);
     die();

  }