我正在写一个集成了facebook的windows手机游戏。我有个问题。Facebook的api登录成功,但没有返回成功纸
我用正确的用户名/密码登录后。它显示:
“...想访问您的公开个人资料...”。
然后按OK。然后另一条消息:
“....想以您的名义发帖”。
还行。它导航到m.facebook.com/dialog/oauth/write
- 一张白纸。没有成功的文件或访问令牌返回。 然后我再次调试。登录后,它导航到Success文件和访问令牌。
我的问题是为什么?有什么方法可以跳过.... 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;
}
}
向我们展示您用于登录的一些代码。 –