我已经添加了Facebook.dll和Facebook.Client.dll,此代码在Windows Phone和Windows 8.1应用程序上可以正常工作,但是在XAML和C#编码的Windows 10应用程序上无法正常工作。有人也有这个问题吗?
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;
}
这部分“等待Session.CheckAndExtendTokenIfNeeded();” 应该是登录发生但什么都没有发生的地方。
这是链接:http : //blogs.windows.com/buildingapps/2015/07/14/windows-sdk-for-facebook/
您可以找到一个新的Facebook Windows SDK,并已登录
PS:您可以在这里查看:https : //azure.microsoft.com/zh-cn/documentation/articles/mobile-services-how-to-register-facebook-authentication/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句