[英]Facebook C# SDK - Mobile Web Page : Facebook Wall Post URL Redirect
我目前正在asp.Net MVC2中的移動web頁面上工作,該頁面允許用戶發布到他們的牆上。 我有以下代碼發布到用戶的牆上,但希望重定向到 Facebook 的移動“發布到我的牆上”視圖,以允許用戶添加到發布的消息並使用“發布”按鈕或“取消”。 我必須自己重新創建這個視圖嗎? 這似乎是很多網站都會使用的東西。
public string PostToWall(string code)
{
string authToken = string.Empty;
try
{
authToken = GetAuthToken(code);
FacebookClient app = new FacebookClient(authToken);
dynamic user = app.Get("me");
var id = user.id;
var args = new Dictionary<string, object>();
args["message"] = "Test Wall Post";
args["caption"] = "Test Caption";
args["description"] = "Test Description";
args["name"] = "Test Name";
//args["picture"] = "[your image URL]";
//args["link"] = "[your link URL]";
app.Post("/me/feed", args);
return string.Empty;
}
catch (Exception ex)
{
_log.ErrorFormat("Error getting the Facebook authentication token. {0}", ex);
return string.Empty;
}
}
謝謝!
[Edit] @OffBySome I set up a rough test using the facebook Javascript SDK and I set it to display: 'touch' but it still pops up in my safari iphone user agent. 我用這個
attachment: {
title: '<my title>',
caption: '<my caption>',
description: (
<my description>
),
name: '<name>',
link: '<link>',
display: 'touch', },
但是這些附件都沒有添加到我的牆貼中。 我做錯了嗎? 對話:Fb.Ui http://developers.facebook.com/docs/reference/javascript/#xfbml
最簡單的方法是使用Facebook javascript sdk 並使用FB.ui 對話框允許用戶共享。 您可以為移動優化對話框設置 display=touch 或 display=wap。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.