首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >facebook登录NotImplementedException错误

facebook登录NotImplementedException错误
EN

Stack Overflow用户
提问于 2014-12-03 10:59:18
回答 1查看 96关注 0票数 1

我正在让facebook登录到我的窗口电话8.1。当单击登录按钮时,它会破坏应用程序,让我知道

“System.NotImplementedException”类型的异常发生在mypriject.exe中,但未在用户代码中处理 补充资料:未执行 如果存在此异常的处理程序,则可以安全地继续该程序。

然后带我到这个app.g.i.cs页面并高亮显示这一行

代码语言:javascript
复制
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
            UnhandledException += (sender, e) =>
            {
                if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
            };

**这是我的代码,请帮助我**

代码语言:javascript
复制
    public sealed partial class BlankPage1 : Page
{
    FacebookClient fb = new FacebookClient();
    string AccessToken = null;
    public BlankPage1()
    {
        this.InitializeComponent();
    }

    /// <summary>
    /// Invoked when this page is about to be displayed in a Frame.
    /// </summary>
    /// <param name="e">Event data that describes how this page was reached.
    /// This parameter is typically used to configure the page.</param>

    private async void Button_Click(object sender, RoutedEventArgs e)
    {
        string redirect_url="https://www.facebook.com/connect/login_seccess.html";
        var loginURL = fb.GetLoginUrl(new{
            client_id ="**myapp id here**",
            redirect_uri = redirect_url,
            response_type ="token",
            scope ="email,publish_stream,user_groups"


        });
          var res= await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None,loginURL,new Uri(redirect_url)  );
        if(res.ResponseStatus==WebAuthenticationStatus.Success)
        {
            var callback = new Uri(res.ResponseData.ToString());
            var token = fb.ParseOAuthCallbackUrl(callback);
            AccessToken = token.AccessToken;
            await new MessageDialog("AccessToken").ShowAsync();
        }
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-11 08:01:54

在Windows 8.1中,AuthenticateAsync将无法使用此

WebAuthenticationBroker.AuthenticateAndContinue(loginURL,空WebAuthenticationOptions.None);

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27269952

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档