Facebook api登录成功但不返回成功论文

时间:2013-08-28 16:09:08

标签: c# facebook windows-phone-7 facebook-graph-api windows-phone-8

我正在写一个集成了facebook的Windows手机游戏。我有一个问题。

用正确的用户名/密码登录后。它显示:

  

“...想要访问您的公开个人资料......”。

我按好。然后是另一条消息:

  

“....想代表你发帖”。

好的。它导航到m.facebook.com/dialog/oauth/write - 一张白纸。未返回成功论文或访问令牌。 然后我再次调试。登录后,它导航到成功纸张和访问令牌。

我的问题是为什么?有没有办法跳过.... would like to post on your behalf消息。


这是我的代码

private void myWeb_Loaded(object sender, RoutedEventArgs e)
    {
        var parameters = new Dictionary<string, object>();

        parameters["client_id"] = appID;
        parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
        parameters["response_type"] = "token";
        parameters["display"] = "popup";
        parameters["scope"] = extendedPermissions;

        Uri loginUri = _fbClient.GetLoginUrl(parameters);

        this.myWeb.Navigate(loginUri);
    }

private void myWeb_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
    {
        MessageBox.Show(e.Uri.AbsoluteUri);
        //myText.Text = e.Uri.AbsoluteUri;
        FacebookOAuthResult oauthResult;
        if (_fbClient.TryParseOAuthCallbackUrl(e.Uri, out oauthResult))
        {
            if (oauthResult.IsSuccess)
            {
                AccessToken = oauthResult.AccessToken;

                MessageBox.Show("Login success!\n" + AccessToken);
                NavigationService.Navigate(new Uri("/TestPape.xaml?token="+AccessToken, UriKind.Relative));
            }
        }
        else
        {
            // The url is NOT the result of OAuth 2.0 authentication.
            return;
        }
    }

1 个答案:

答案 0 :(得分:0)

  

是否有某种方法可以跳过....想要代表你发布

您在登录时添加了权限publish_action / publish_stream,这就是为什么它会向您显示第二个权限窗口。如果在您的应用程序中,您要代表用户发布Feed,则需要用户授予这些权限;但如果你不想发布任何内容;您可以删除这些权限。