我有一个应用程序,当他们允许时,我可以发布到用户的墙上。但是,当应用程序发布墙贴时,它会显示它来自我(应用程序的管理员)在用户墙上发布。我希望它看起来像是在他们自己的墙上发布的实际用户...(使用VS 2008,.Net 3.5)
这是我的代码......
Dim oFB As Facebook.FacebookClient
Dim sAppId As String = "my app id"
Dim sAppSecret As String = "it's a secret"
Dim webClient As System.Net.WebClient = New System.Net.WebClient()
Dim result As String = webClient.DownloadString("https://graph.facebook.com/oauth/access_token?client_id=" & sAppId & "&client_secret=" & sAppSecret & "&grant_type=client_credentials")
'- Access token changes every hour
oFB = New Facebook.FacebookClient(sAppId, sAppSecret)
oFB.AccessToken = result.Substring(result.IndexOf("=") + 1)
Dim oPost As Collections.Generic.IDictionary(Of String, Object)
oPost = New Collections.Generic.Dictionary(Of String, Object)
oPost.Add("message", "(websitepipeline test post) Check out this new product!") '- This is the wall post / the description input for the DM function
oPost.Add("link", "http://www.example.com/content/somepage.html")
oPost.Add("from", "the user who authenticated")
oFB.Post("the user who authenticated/feed", oPost)
答案 0 :(得分:0)
这是一个链接到某人为.NET制作的图书馆的链接;)[link] http://www.lagorio.net/windows/facebook/)显然你需要提出一个FBDialog询问用户他的凭据当然! :)不太确定你使用的库,但是“from”的字符串可能不正确或者需要是某种用户令牌
使用带有此API的.setStatus命令。