我開始使用Facebook C#SDK。我如何處理官方SDK文檔中的消息?我如何閱讀和發送消息?有沒有任何教程?如何使用Facebook C#SDK讀取/發送私人信息?
回答
的Facebook不允許SDK發送私人信息,防止誤操作垃圾郵件發送者
這是用於發送消息..
使用Facebook C#SDK(http://facebooksdk.codeplex.com)
var app = new FacebookApp("access_token");
var parameters = new Dictionary<string, object>();
parameters["message"] = "This is a test message";
app.Api("/me", parameters, HttpMethod.Post);
這將發佈一條消息到當前用戶的壁。您也可以使用該SDK發佈圖像。有關如何做這些測試的樣本。請注意,如果你的意思是你想給他們發送私人消息,而不是在他們的牆上張貼這是不可能的。 Facebook不允許應用程序直接向用戶發送消息。
你好我的意思是私人消息!如何閱讀私人信息? –
因此,如果Facebook不允許發送私人消息,微軟發佈的Facebook應用程序如何[鏈接](http://www.windowsphone.com/fr-FR/apps/82a23635-5bd9-df11-a844-00237de2db9e)是能夠發送/閱讀私人信息? –
我在facebook FQL [link](https://developers.facebook.com/docs/reference/fql/message/)中發現了這個,我認爲它很重要!它顯示瞭如何從MESSAGE表中檢索信息。我怎樣才能做到這一點與facebbok-c#-sdk? –
要訪問消息(聊天的)u必須有read_mailbox擴展權限(我認爲),不喜歡:
string facebookToken = "your facebook token here";
var client = new FacebookClient(facebookToken);
dynamic result = client.Get("me/inbox", null);
foreach (dynamic item in result.inbox.data)
{
//item is a conversation
//the latest updated conversations come first so
//im just gona grab the first conversation with unreaded/unseen messages
if (item.unread > 0 || item.unseen > 0)
{
string conversationID = item.id;
string otherPerson = item.to.data[1].name;//the item.to.data[0] its myself
//you can access the messages of the conversation like
//by default it will return the last 25 messages, u can get more, by making a call too
//"https://graph.facebook.com/{0}/comments?limit={1}" like:
//dynamic result = client.Get(string.Format("{0}/comments?limit={1}",conversationID, 100), null);
foreach (dynamic message in item.comments.data)
{
//Do want you want with the messages
string id = message.id;
string fromName = message.from.name;
string fromID = message.from.id;
string text = message.message;
string createdDate = message.created_time;
}
//To send a message in this conversation, just
dynamic parameters = new ExpandoObject();
parameters.message = "A message from code!";
client.Post(string.Format("{0}/comments", conversationID), parameters);
//or
//client.Post(string.Format("{0}/comments", conversationID), new Dictionary<string, object> { { "message", "A message from code!" } });
//NOTE!! - The application must be on white list for you te be able to post a message
// read - https://developers.facebook.com/docs/ApplicationSecurity/
break;
}
}
您可以在https://developers.facebook.com/tools/explorer
更多的嘗試:
Inbox Notifications, Message Info
希望它幫助;)
這是怎麼使用C#來顯示收件箱,asp.net:
protected void Button4_Click(object sender, EventArgs e)
{
var fb = new FacebookClient(lblToken.Text);
var query = string.Format(@"SELECT message_id, author_id, body, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0)");
dynamic parameters = new ExpandoObject();
parameters.q = query;
dynamic results = fb.Get("/fql", parameters);
List<MyMessage> q = JsonConvert.DeserializeObject<List<MyMessage>>(results.data.ToString());
GridView4.DataSource = q;
GridView4.DataBind();
}
- 1. 發送私人消息facebook sdk android
- 2. 如何使用android facebook sdk向其他用戶發送私人消息?
- 3. 如何讓Facebook像私人信息
- 4. 如何在Facebook應用程序中向一位用戶發送私人信息?
- 5. 我可以使用Facebook API讀取私人訊息嗎?
- 6. 如何發送信息到Facebook朋友的牆上android SDK 3.0
- 7. 如何使用asp.net向用戶發送私人消息?
- 8. 私人信息與
- 9. 如何從Facebook獲取用戶的朋友,並通過使用C#Facebook SDK向他們發送所有消息?
- 10. iOS 6 - ChatKit私人API - 發送短信
- 11. 如何將Facebook私人信息保存到數據庫?
- 12. Android:獲取用戶提供的信息發送到私人電子郵件
- 13. 使用Nexmo發送短信,使用私人網絡時失敗
- 14. MongoDB:私人消息系統...如何跟蹤發送的消息
- 15. 選擇Facebook好友併發送消息C#Facebook SDK
- 16. 如何發送用戶收到私人消息的通知
- 17. 發送私人消息到使用軌道上的紅寶石的Facebook帳戶
- 18. 如何從私人測試版應用獲取調試信息?
- 19. 如何從socket.io-redis發送私人消息(發出)
- 20. Facebook的私人消息
- 21. 如何在Facebook上使用C#SDK使相冊私密化
- 22. 如何發送在Koala,Ruby on Rails的私人消息/訪問Facebook聊天
- 23. 使用目標讀取MP3信息c
- 24. 如何不使用C#SDK自動發送Docusign信封並獲取URL
- 25. 如何使用C#將消息發送到Facebook收件箱?
- 26. 如何使用ASP.NET 3.5和C將消息發送到Facebook#
- 27. 發送主人詳細信息表格
- 28. Android perimision「用戶的私人信息」,「您的個人信息」,「讀取敏感日誌數據」
- 29. 使用Node.js和Socket.io發送私人消息
- 30. java如何發送信息?
http://stackoverflow.com/questions/15862161/how-to-send-private-messages-using-the-facebook-c-sharp-sdk –