英文:
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 "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>
);
}
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论