2014-02-06 22 views
1

我使用Facebook SDK for .NET我可以使用應用程序令牌發佈到用戶牆上。代碼如何添加動作在Facebook牆上發佈?

例如當我創建信息:

 dynamic messagePost = new ExpandoObject(); 
     messagePost.picture = "http://cs608830..........jpg"; 
     messagePost.name = "A......."; 
     messagePost.message = "I........ "; 
     messagePost.link = "http://a......."; 
     messagePost.req_perms = "publish_stream"; 
     messagePost.scope = "publish_stream"; 
     messagePost.actions = 
      "[{\"name\": \"View on .....\",\"link\": \"https://play.google.com/store/apps/details?id=com.........\"}]"; 
     messagePost.privacy = new 
     { 
      value = "SELF" 
     }; 

及其職位不錯,但我想添加第二個動作:

messagePost.actions = 
      "[{\"name\": \"View on Play Market\",\"link\": \"https://play.google.com/store/apps/details?id=com.....\"}, 
       {\"name\": \"View on iTunes \",\"link\": \"https://itunes.apple.com/us/app/sla......\"} ]"; 

但是當我添加塞康行動,我得到一個錯誤:

(OAuthException - #100) (#100) actions should be a JSON-encoded dictionary with "name" and "link" keys 

我舒爾我可以因爲在文檔添加第二個動作我看到下一個: actions - 該帖子可用操作的列表(包括評論,喜歡和可選的應用程序指定的操作) 所以我在做什麼錯?

回答

1

I am shure that I can add second action

然後你錯了。

actions - A list of available actions on the post (including commenting, liking, and an optional app-specified action)

的第一批是FB默認操作 - 並且有an optional應用,指定操作 - 奇異。

+0

我明白了。非常感謝。 – Oleh