Anb*_*nbu 6 facebook objective-c ios
我正在使用Xcode 7.0,在iOS 9.0.2上测试并使用Facebook SDK 4.7.0.Code = 308"(null)" iOS 9中出现问题.我在项目中使用了objective-c代码.怎么解决这个?下面附上我的代码.
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logInWithReadPermissions:@[@"public_profile",@"email", @"user_friends"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error){
if ([FBSDKAccessToken currentAccessToken]) { startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
}
}];
}
}];
Run Code Online (Sandbox Code Playgroud)
试试这个代码:
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
login.loginBehavior = FBSDKLoginBehaviorWeb;
[login logInWithReadPermissions:@[@"email"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error)
{
// Process error
}
else if (result.isCancelled)
{
// Handle cancellations
}
else
{
if ([result.grantedPermissions containsObject:@"email"])
{
NSLog(@"result is:%@",result);
[self fetchUserInfo];
[login logOut];
}
}
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5540 次 |
| 最近记录: |