32 facebook objective-c ios ios9 xcode7
在iOS 8中使用logInWithReadPermissions登录时效果很好,但是在更新到iOS 9后不久它就会打开Safari或模态UIWebView.
有没有人有同样的问题?
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login setLoginBehavior:FBSDKLoginBehaviorNative];
[login logInWithReadPermissions:@[@"public_profile",@"email"] fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
NSLog(@"");
}];
Run Code Online (Sandbox Code Playgroud)
Luc*_*ito 39
似乎在iOS9 +中使用newests FB SDK无法获得以前的行为.您可以使用旧的SDK来执行此操作.以下是facebook对该问题的回复:
sal*_*t5r 15
从现在开始您可以将loginBehavior更改为FBSDKLoginBehaviorSystemAccount,以便FBSDKLoginManager从iOS Facebook设置获取Facebook登录用户;)
FBSDKLoginManager *fbLogin = [[FBSDKLoginManager alloc] init];
fbLogin.loginBehavior = FBSDKLoginBehaviorSystemAccount;
Run Code Online (Sandbox Code Playgroud)
来自FBSDKLoginManager:
声明:FBSDKLoginBehaviorSystemAccount
描述:如果该应用程序无法使用该帐户(未由用户配置或由SDK确定),则此行为将回退到FBSDKLoginBehaviorNative.
注意:如果该应用程序无法使用该帐户(未由用户配置或由SDK确定),则此行为将回退到FBSDKLoginBehaviorNative.
小智 9
使用20150708在iOS 9中为我解决了它.
链接到SDK:https://developers.facebook.com/resources/FacebookSDKs-iOS-20150708.pkg
| 归档时间: |
|
| 查看次数: |
18028 次 |
| 最近记录: |