我正在使用 fb ios sdk 3.5,我尝试运行包附带的名为Scrumptious的示例项目 ,它使用 FBLoginView 进行登录,但 FBLoginView 在 iOS5.0 上不起作用。当我按下 FBLoginVIew 时,它保持按下状态并且没有任何操作。虽然它在 iOS6 上运行良好。它打开 Safari 进行登录。我只在模拟器上进行测试,因为我没有设备。FLoginView 是否仅适用于 iOS6 设备?
- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView {
// Upon login, transition to the main UI by pushing it onto the navigation stack.
SCAppDelegate *appDelegate = (SCAppDelegate *)[UIApplication sharedApplication].delegate;
[self.navigationController pushViewController:((UIViewController *)appDelegate.mainViewController) animated:NO];
}
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
// Facebook SDK * login flow *
// It is important to always handle session closure because it can happen
// externally; for example, if the current session's access token becomes
// invalid. For this sample, we simply pop back to the landing page.
SCAppDelegate *appDelegate = (SCAppDelegate *)[UIApplication sharedApplication].delegate;
if (appDelegate.isNavigating) {
// The delay is for the edge case where a session is immediately closed after
// logging in and our navigation controller is still animating a push.
[self performSelector:@selector(logOut) withObject:nil afterDelay:.5];
} else {
[self logOut];
}
}