LINE Messenger中的URL预览在具有OGP设置的Next.js应用中无法正常工作

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

URL preview not working in LINE messenger for Next.js app with OGP settings

问题

我有一个使用OGP设置来为社交媒体平台生成URL预览的Next.js应用程序。它在Facebook调试器和其他平台上运行正常,但在LINE Messenger和WhatsApp上不起作用。它们根本不显示任何预览。

我已经按照这篇文章中的说明检查了我的LINE Messenger中的OGP设置。以下是我的代码示例:

import Head from "next/head";

export default function Home() {
  return (
    <div>
      <Head>
        <title>My Next.js App</title>
        <meta property="og:title" content="My Next.js App" />
        <meta
          property="og:description"
          content="This is a sample app for OGP settings"
        />
        <meta property="og:image" content="https://example.com/my-image.jpg" />
        <meta property="og:url" content="https://example.com/" />
      </Head>
      <h1>My Next.js App</h1>
      <p>This is a sample app for OGP settings</p>
    </div>
  );
}

我还检查了页面源代码视图,并发现元标记在页面源代码视图中可用。

我已经将我的应用程序部署到AWS Amplify并使用Facebook调试器进行了测试。它显示了预期的正确预览。

然而,当我尝试在LINE Messenger或WhatsApp中分享相同的URL时,它们根本不显示任何预览。

我尝试清除了这两个应用程序的缓存并重新分享了URL,但没有帮助。

这个问题的原因是什么?我该如何修复它?

英文:

I have a Next.js app that uses OGP settings to generate URL previews for social media platforms. It works fine for Facebook debugger and other platforms, but it doesn't work for LINE messenger and WhatsApp. They don't show any preview at all.

I have followed the instructions from this article to check the OGP settings in my LINE messenger. Here is an example of my code:

import Head from &quot;next/head&quot;;

export default function Home() {
  return (
    &lt;div&gt;
      &lt;Head&gt;
        &lt;title&gt;My Next.js App&lt;/title&gt;
        &lt;meta property=&quot;og:title&quot; content=&quot;My Next.js App&quot; /&gt;
        &lt;meta
          property=&quot;og:description&quot;
          content=&quot;This is a sample app for OGP settings&quot;
        /&gt;
        &lt;meta property=&quot;og:image&quot; content=&quot;https://example.com/my-image.jpg&quot; /&gt;
        &lt;meta property=&quot;og:url&quot; content=&quot;https://example.com/&quot; /&gt;
      &lt;/Head&gt;
      &lt;h1&gt;My Next.js App&lt;/h1&gt;
      &lt;p&gt;This is a sample app for OGP settings&lt;/p&gt;
    &lt;/div&gt;
  );
}

I have also inspected the page source view and found that the meta tags were available in the page source view.

I have deployed my app to AWS Amplify and tested it with Facebook debugger. It shows the correct preview as expected.

However, when I try to share the same URL in LINE messenger or WhatsApp, they don't show any preview at all.

I have tried clearing the cache of both apps and re-sharing the URL, but it didn't help.

What could be the reason for this issue? How can I fix it?

答案1

得分: 0

以下是翻译好的内容:

这是与AWS Amplify相关的问题。
AWS的一位专家正在修复这个问题

英文:

It turned out as an issue with AWS Amplify.
One of the AWS experts is working on fixing the issue.

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

发表评论

匿名网友

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

确定