이 SDK를 사용하여 로그인하고 FB에서 사용자 정보를 가져옵니다. 저에게 잘 작동합니다. 페이스 북을 통한 로그인 iOS의 로그인
이
내가 그런 경우- (IBAction)fbLogin_click:(id)sender
{
if (AppDelegate.fbsession.state != FBSessionStateCreated) {
// Create a new, logged out session.
NSArray *permissions = [NSArray arrayWithObjects:@"offline_access", @"email", @"publish_stream", @"read_stream",@"read_friendlists",@"manage_friendlists",@"friends_about_me",@"publish_actions", nil];
// create a session object, with defaults accross the board, except that we provide a custom
// instance of FBSessionTokenCachingStrategy
AppDelegate.fbsession = [[FBSession alloc] initWithAppID:nil
permissions:permissions
urlSchemeSuffix:nil
tokenCacheStrategy:nil];
}
FBSessionLoginBehavior behavior = FBSessionLoginBehaviorForcingWebView;
if (AppDelegate.fbsession.state != FBSessionStateCreatedTokenLoaded) {
// even though we had a cached token, we need to login to make the session usable
[AppDelegate.fbsession openWithBehavior:behavior completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
if (error)
{
NSLog(@"Error");
}
[self GetFBUserDetails];
}];
}
}
-(void) GetFBUserDetails
{
if (AppDelegate.fbsession.isOpen)
{
[HUD show:YES];
// fetch profile info such as name, id, etc. for the open session
FBRequest *me = [[FBRequest alloc] initWithSession:AppDelegate.fbsession graphPath:@"me"];
self.pendingRequest= me;
[me startWithCompletionHandler:^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *user,
NSError *error) {
// because we have a cached copy of the connection, we can check
// to see if this is the connection we care about; a prematurely
// cancelled connection will short-circuit here
if (me != self.pendingRequest) {
return;
}
self.pendingRequest = nil;
// self.pendingLoginForSlot = -1;
// we interpret an error in the initial fetch as a reason to
// fail the user switch, and leave the application without an
// active user (similar to initial state)
if (error) {
return;
}
[AppDelegate.fbsession closeAndClearTokenInformation];
[FBSession.activeSession close];
[FBSession.activeSession closeAndClearTokenInformation];
FBSession.activeSession=nil;
[self FacebookCustomerRegister:user];
}];
}
}
을 uisng있어 그가 내 응용 프로그램을 통해 로그인 할 때 일부 사용자가 이메일을 통해 매우 자신의 계정을 페이스 북 계정을 생성하지 코드는 클릭 로그인 후 빈 화면을 보여줍니다입니다 버튼을 누르면 더 이상의 조치가 없습니다. 사용자에게 "FB 계정을 아직 확인하지 않았습니다."라고 알리고 내 앱으로 돌아 가지 않을 수있는 방법은 무엇입니까? 거기에서 응답을 가져올 수 있습니까?
누구든지 나를 도울 수 있습니까?
안녕이 페이지를 참조하시기 바랍니다, 나는 화면 반바지 추가가 http://stackoverflow.com/questions/20946555/facebook-login-via-app-with-unverified-user-account-in -fb – Rajesh
올바른 문제를 해결할 수있는 사파리로 앱을 전환하는 이유 – Retro