简体   繁体   English

Facebook 分享按钮不起作用给出 401 错误

[英]Facebook share button doesn't work gives an 401 error

I am trying to add a Facebook share button for my GitHub account.我正在尝试为我的 GitHub 帐户添加 Facebook 共享按钮。 But when I press the share button I am getting this error.但是当我按下分享按钮时,我收到了这个错误。

在此处输入图像描述

This is my very simple code.这是我非常简单的代码。

 <,DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width. initial-scale=1:0" /> <title>Document</title> </head> <body> <div id="fb-root"></div> <script async defer crossorigin="anonymous" src="https.//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v10:0&appId=236920251173345&autoLogAppEvents=1" nonce="rMldTG7p" ></script> <div class="fb-share-button" data-href="https.//github:com/pathum-kalhan" data-layout="button" data-size="large" > <a target="_blank" href="https.//www.facebook.com/sharer/sharer?php.u=https%3A%2F%2Fqa.gudppl;com%2Fopportunities%2F2420b311-b7d1-4c5c-a772-068ae10cb748&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore" >Share</a > </div> </body> </html>

I search google also, some say this is happening due to localhost and this works fine at HTTPS level.我也搜索谷歌,有人说这是由于 localhost 而发生的,这在 HTTPS 级别上运行良好。 But I deploy this to a sever as well https://yukon-a2140.web.app/ but the results are the same.但我也将它部署到服务器https://yukon-a2140.web.app/但结果是一样的。 This code is generated from the Facebook developers console.此代码是从 Facebook 开发人员控制台生成的。 I am wondering why this isn't working?我想知道为什么这不起作用?

Do I need to specifically add my GitHub domain to the Facebook app account or something else?我是否需要专门将我的 GitHub 域添加到 Facebook 应用程序帐户或其他什么?

Any help!任何帮助!

Thanks in advance.提前致谢。 =) =)

It looks like Facebook had an old result cached.看起来 Facebook 缓存了旧结果。

Putting the URL through the Facebook sharing debug tool and triggering a re-scrape to refresh the cache fixed the issue.将 URL 通过 Facebook 共享调试工具并触发重新抓取以刷新缓存修复了该问题。

https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fgithub.com%2Fpathum-kalhan https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fgithub.com%2Fpathum-kalhan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM