C# 错误:Xamarin.Form中的“com.facebook.sdk.login Error 308”
我正在使用Visual Studio 2017。我试图通过无法连接来使用以下代码连接Facebook。谁能告诉我我错过了什么?我试过许多解决办法,但都不管用C# 错误:Xamarin.Form中的“com.facebook.sdk.login Error 308”,c#,facebook-graph-api,xamarin.forms,xamarin.ios,C#,Facebook Graph Api,Xamarin.forms,Xamarin.ios,我正在使用Visual Studio 2017。我试图通过无法连接来使用以下代码连接Facebook。谁能告诉我我错过了什么?我试过许多解决办法,但都不管用 public void LogInToFacebook() { if (AccessToken.CurrentAccessToken == null) { ObtainNewToken(LogInToFacebook); return; } } 获取错误:操作无法完成。com.fac
public void LogInToFacebook()
{
if (AccessToken.CurrentAccessToken == null)
{
ObtainNewToken(LogInToFacebook);
return;
}
}
获取错误:操作无法完成。com.facebook.sdk.login错误308
private readonly string[] permissions = { "public_profile", "email", "user_birthday", "user_photos" };
private void ObtainNewToken(Action callback)
{
var login = new LoginManager();
login.LogInWithReadPermissions(permissions, null, (r, e) =>
{
if (e == null && !r.IsCancelled)
callback?.Invoke();
else
HandleError(e?.LocalizedDescription);
});
}
info.plist:Facebook相关内容
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>myapp.com</key>
<dict>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
<string>fb-messenger-api</string>
<string>fbshareextension</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb90000000000</string>
</array>
<key>CFBundleURLName</key>
<string>facebook</string>
</dict>
</array>
<key>FacebookAppID</key>
<string>8000666666666</string>
<key>FacebookDisplayName</key>
<string>MyApp – Test</string>
我已解决了上述错误。我只是跟着说: 上面的文章是facebook整合的例子。我们还可以下载该项目并按照文章中给出的方式运行它
那么,问题是什么!问题是我的facebook.dll,或者我们可以说SDK比较旧。我已经更新了它并更新了info.plist文件,正如我从上述文章下载的演示项目中所给出的。代码没有变化 @Jason的可能副本请仔细阅读问题。我使用的VisualStudio在这个问题上没有建议的解决方案。