我正在用C#构建一个Windows Store 8.1应用程序。这是一个照相亭应用程序,所以很多不同的人都会走到一个设备前拍照。
该应用程序的功能之一是能够在社交媒体网站上分享你的照片。我能够使用WebAuthenticationBroker实现Facebook登录。然而,我接下来需要做的是发布他们的照片,然后注销Facebook。我最不想看到的是其他人拿着另一个人的缓存凭据来到照相馆。
关于如何在这里进行,我可以提出任何建议。以下是我用来登录的代码:
WebAuthenticationResult authenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, new Uri("https://www.facebook.com/dialog/oauth?client_id=MyAppId&response_type=token&scope=publish_actions&redirect_uri=" + WebAuthenticationBroker.GetCurrentApplicationCallbackUri()));
经过巨大的努力,我也能够捕捉到Facebook注销URL应该是什么样子:
https://www.facebook.com/logout.php?access_token=MyAccessToken&next=https%3A%2F%2Fwww.facebook.com%2Fconnect%2Login_success.html
有人想出这个了吗?
您的确切问题是什么?如何将照片发布到Facebook?
尽管Facebook没有官方的C#SDK,但以下可能是最容易使用的:http://facebooksdk.net/docs/windows/
否则,您可以实现对{user_id}/photos
的原始API调用和POST,如下所述:https://developers.facebook.com/docs/graph-api/reference/user/photos/#Creating
当你的应用程序处于活动状态时,你还需要提交审查并申请publish_actions
和user_photos
许可。