Apple AppClip Card无法启动的原因是什么?

huangapple go评论43阅读模式
英文:

Why Apple AppClip Card does not launch?

问题

我们有一个带有关联的App Clip的苹果应用程序。从我们的网站上,当用户访问特定的URL,比如https://www.example.com/abc/xyz/appclip_page时,我们希望用户能看到App Clip。用户最初访问另一个页面,即https://www.example.com/abc/xyz/initial_page。页面上有一个按钮,当点击时应将用户重定向到appclip_page。在那一点上,我们希望用户能看到启动的App Clip卡片并完成相关任务,而不需要安装完整的应用程序。
但是,当用户通过点击按钮访问URL时,我们并没有看到App Clip启动。

  1. 创建了具有在Apple Store Connect上配置的App Clip的应用程序。
  2. 在网站上创建了apple-app-site-association文件,可以在https://www.example.com/.well-known/apple-app-site-association上访问。
  3. 将www.example.com添加到关联域,并在Apple Store Connect中显示为已验证。
  4. 创建了网站页面并在调用URL页面中添加了类似以下的元标记:
    <meta name="apple-itunes-app" content="app-id=myAppStoreID, app-clip-bundle-id=appClipBundleID, app-clip-display=card">

尝试使用不同配置的apple-app-site-association文件,还尝试为应用程序设置高级App Clip体验。然而,无论哪种配置,App Clip都无法启动。

请查看我们使用的关联文件如下:

{
"appclips": {
"apps": [ "TEAMID.com.example.app.Clip" ]
},
"applinks": {
"apps":[],
"details": [
{
"appIDs": [
"TEAMID.com.example.app.Clip",
"TEAMID.com.example.app"
],
"components": [
{
"/": "/xyz/company/app/",
"comment": "Launches the app clip for a company on Safari"
},
{
"/": "/xyz/
/app/*",
"comment": "Launches the app clip on Safari - regex"
}
]
}
]
}
}

英文:

We have an Apple app with associated App Clip. And from our website we would like our users to see the App Clip when they visit a particular url, say, https://www.example.com/abc/xyz/appclip_page.
Users initially visit another page, i.e. https://www.example.com/abc/xyz/initial_page. There is a button on the page, when clicked should redirect users to appclip_page. At that point, we want users to see App Clip card launched and complete the associated task without installing full App.
But, we do not see the App Clip launching when users visit the url by clicking the button.

  1. Created App with app clip configured on apple store connect.
  2. Created apple-app-site-association file on the website which is accessible at https://www.example.com/.well-known/apple-app-site-association
  3. Added www.example.com to associated domains and it shows as verified in apple store connect.
  4. Created the website with pages and added meta tag similar to below in the invocation url page:
    <meta name="apple-itunes-app" content="app-id=myAppStoreID, app-clip-bundle-id=appClipBundleID, app-clip-display=card">

Tried using different configurations of apple-app-site-association file, also tried setting up advanced app clip experience for the app. However none of the configuration works and app clip does not launch.

Please find below the association file we use:

{
  &quot;appclips&quot;: {
      &quot;apps&quot;: [ &quot;TEAMID.com.example.app.Clip&quot; ]
  },
  &quot;applinks&quot;: {
      &quot;apps&quot;:[],
      &quot;details&quot;: [
          {
              &quot;appIDs&quot;: [
                  &quot;TEAMID.com.example.app.Clip&quot;,
                  &quot;TEAMID.com.example.app&quot;
              ],
              &quot;components&quot;: [
                  {
                      &quot;/&quot;: &quot;/xyz/company/app/*&quot;,
                      &quot;comment&quot;: &quot;Launches the app clip for a company on Safari&quot;
                  },
                  {
                      &quot;/&quot;: &quot;/xyz/*/app/*&quot;,
                      &quot;comment&quot;: &quot;Launches the app clip on Safari - regex&quot;
                  }
              ]
          }
      ]
   }
}

答案1

得分: 0

问题已通过在服务器端呈现与 appclip 相对应的页面(https://www.example.com/abc/xyz/appclip_page)而不是在客户端呈现来解决。

即需要为 appclip 添加一个 HTML meta 标签,如此处所述:https://developer.apple.com/documentation/app_clips/supporting_invocations_from_your_website_and_the_messages_app。
最初在客户端上呈现,可能是因为客户端页面渲染较慢而导致不一致的行为。
一旦将 meta 标签的呈现移至服务器端,appclip 将如预期地成功启动。

英文:

The issue is resolved for us by rendering the page corresponding to appclip (https://www.example.com/abc/xyz/appclip_page) on server-side instead of rendering on the client-side.

i.e. A HTML meta tag for the page is required for appclip as described here: https://developer.apple.com/documentation/app_clips/supporting_invocations_from_your_website_and_the_messages_app.
It was initially rendered on client side and caused inconsistent behavior potentially due to slow rendering of page on client side.
Once meta tag rendering is moved to server side, the appclip is being successfully launched as expected.

huangapple
  • 本文由 发表于 2023年5月10日 11:33:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76214715.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定