如何在Universal Windows Platform c#
中添加Facebook页面提要帖子和评论我想在帖子中添加我的Facebook页面的帖子和评论以及有多少喜欢 但我没有找到任何帮助??
答案 0 :(得分:0)
您可以使用webview控件嵌入评论
参考:https://developers.facebook.com/docs/plugins/embedded-comments#desktoplayout
XAML代码:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<WebView x:Name="MyWebView"/>
</Grid>
MainPage.xaml.cs中
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void LoadLocalHtml()
{
MyWebView.Navigate(new Uri("ms-appx-web:///Assets/demo.html"));
}
}
demo.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DEMO</title>
<link rel="stylesheet" type="text/css" href="css/bmap.css" />
</head>
<body>
<div id="fb-root"></div>
<script>
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comment-embed"
data-href="https://www.facebook.com/zuck/posts/10102735452532991?comment_id=1070233703036185"
data-width="500"></div>
<iframe src="https://www.facebook.com/plugins/comment_embed.php?href=https%3A%2F%2Fwww.facebook.com%2Fzuck%2Fposts%2F10102577175875681%3Fcomment_id%3D1193531464007751%26reply_comment_id%3D654912701278942&width=320&include_parent=true&height=332&appId" width="320" height="332" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</body>
</html>
答案 1 :(得分:0)
您可以使用UWP社区工具包Facebook Service类,我已经编写了示例应用程序,如何将Facebook发布到UWP应用程序中。 URL如下所示。
http://www.c-sharpcorner.com/article/facebook-service-into-uwp-app-using-uwp-community-toolkit/
希望它对你有用。