简体   繁体   English

facebook登录Win10应用程序的问题

[英]Issue with facebook Login Win10 app

I have added the Facebook.dll and the Facebook.Client.dll, this code works fine on the Windows Phone and Windows 8.1 app however its not working on the Windows 10 application coded in XAML and C#.我添加了 Facebook.dll 和 Facebook.Client.dll,此代码在 Windows Phone 和 Windows 8.1 应用程序上运行良好,但它不适用于以 XAML 和 C# 编码的 Windows 10 应用程序。 Is anyone having this issue also?有人也有这个问题吗?

  public async Task<string> LogIntoFacebook()
        {
            //var session = new Session();
            Session FacebookSessionClient = new Session(Constants.FacebookAppId);

            try
            {
                FacebookSessionClient.LoginWithBehavior(_FacebookPermissions, FacebookLoginBehavior.LoginBehaviorAppwithMobileInternetFallback);

                await Session.CheckAndExtendTokenIfNeeded();

            }
            catch (FacebookOAuthException exception)
            {
                SimpleIoc.Default.GetInstance<IErrorService>().ReportErrorInternalOnly(exception);
                return null;
            }
            catch (InvalidOperationException ex)
            {
                SimpleIoc.Default.GetInstance<IErrorService>().ReportErrorInternalOnly(ex);
                return null;
            }
            catch (Exception ex)
            {
                SimpleIoc.Default.GetInstance<IErrorService>().ReportErrorInternalOnly(ex);
                return null;
            }


            return null;

        }

This part "await Session.CheckAndExtendTokenIfNeeded();"这部分“等待 Session.CheckAndExtendTokenIfNeeded();” should be where the login happens but nothing happens.应该是登录发生但什么也没发生的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM