0

我创建了 Shopware 应用程序。我想在 iframe 中展示我的应用程序。但总是显示“哎呀!你移动得太快了,失去了方向。”

这是我的 manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/trunk/src/Core/Framework/App/Manifest/Schema/manifest-1.0.xsd">
    <meta>
        <name>TF</name>
        <label>TF</label>
        <label lang="de-DE">TF</label>
        <author>TF</author>
        <copyright></copyright>
        <version>1.0.0</version>
        <license>MIT</license>
    </meta>
    <setup>
        <secret>test</secret>
        <registrationUrl>https://example.com/shopware/register</registrationUrl>
    </setup>
    <permissions>
        <read>order</read>
        <read>product</read>
    </permissions>
    <admin>
        <main-module source="https://example.com/app/shopware"/>
    </admin>
</manifest>

我正在为我的网站使用 Laravel。我创建了类似的路线

Route::get('/app/shopware', 'ShopwareController@showApp');

我的功能是

public function showApp(Request $request)
{
   echo 'Showing TF';
}

如果我直接访问此 URL,它工作正常,但在 Shopware 中显示这样的错误

在此处输入图像描述

如何解决这个问题?

谢谢

4

2 回答 2

0

我认为您需要在响应 html 中添加脚本代码

<script>
    window.onload = function () {
        window.parent.postMessage('sw-app-loaded', '*');
    }
</script>
于 2022-02-08T08:06:19.840 回答
0

我认为您需要将商店 ID 和时间戳附加到 registrationUrl 标记中的 url。这可能是商店软件引发此错误的原因。

在这里查看App Base Guide

有一个请求应该是什么样子的例子。

于 2021-11-22T11:31:54.363 回答