开始安装带有链接的iOS应用程序


Start Installing iOS App with link

我在控制器中有以下功能:

/**
 * @Route("/{language}/apps/{application}", defaults={"application":"all"}, name="apps")
 */
public function indexAction( $application )
{
    $url['app'] = "itms-services://?action=download-manifest&url=https://www.xxx.xx/appfiles/App.plist";
    switch ($application) {
        case "app":
            return new Response($this->generateUrl($url['app']));
            break;
        default:
            return $this->render('AppBundle::app.html.twig',
                array(
                    "app" => $url['app']
                )
            );
            break;
    }
}

该应用程序是ios应用程序。

当我在我的html.twig-file中查看链接

<a href="{{ app }}">MBS-App installieren</a>

应用程序将在iPad或iPhone上开始安装。但是,当我尝试做出一个新的响应,然后字符串将在浏览器上查看,但没有动作开始在平板电脑上。

我该如何改变它?

你应该重定向到那个URL,而不是返回一个响应:

    case "app":
        return $this->redirect($url['app']);
        break;