c# - WebAuthenticationResult - System.NotImplementedException

标签 c# facebook windows-phone-8.1 win-universal-app

我正在尝试实现 Facebook authentication sample , 当代码到达;

 WebAuthenticationResult webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
      WebAuthenticationOptions.None,loginUrl);

我遇到如下异常;

Exception = {System.NotImplementedException: Not implemented

at Windows.Security.Authentication.Web.WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions options, Uri requestUri) at SonglyWindowsPhone.Views.Login.d__0.MoveNext() --- End ...

Message: The method or operation is not implemented.

有解决办法吗?

最佳答案

在 WinRT 中它是 similar situation to FilePickers - 你必须使用 AuthenticateAndContinue method .使用该方法后,您的应用将停用,并在完成身份验证后将被激活,此时您应该处理 app.xaml.cs 中的 OnActivated 事件:

protected async override void OnActivated(IActivatedEventArgs args)
{
    base.OnActivated(args);
    var continuationEventArgs = args as IContinuationActivatedEventArgs;
    if (continuationEventArgs != null)
    {
        switch (continuationEventArgs.Kind)
        {
            case ActivationKind.WebAuthenticationBrokerContinuation:
                ValueSet data = continuationEventArgs.ContinuationData;
                // continue web authentication
                break;
                // rest of code

WebAuthenticationBroker class您还会找到示例链接。

here at MSDN很好地解释了示例代码。

关于c# - WebAuthenticationResult - System.NotImplementedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27476910/

相关文章:

iphone - 在 Facebook 上发布链接不显示链接缩略图?

用于读取书签项的 Facebook API

ios - 无法从 iOS 发送 facebook apprequest,因为 FBSession.activeSession.isOpen 给出 false

c# - 具有 2 个中心部分的 Windows Phone 8.1 应用程序

c# - 如何在单向 ASMX Web 服务中获取客户端 IP 地址

c# - 将Brotli编译成DLL .NET可以引用

c# - 如何将调试文本从 C# 类发送到 ASP.NET 页面

xaml - 如何将 AppBarButton 图标添加到 Windows Phone 8.1 中的普通按钮?

c# - 检查 Microsoft Band 设备是否已连接

c# - WPF - 恢复 ComboBox ItemSsource 中的上一个 SelectedItem 已更改