Я использую facebook-ios-sdk-3.10, используя этот SDK. Я заберу и заберу данные пользователя у FB.Войдите в систему через facebook sdk в ios
Это код, я uisng
- (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];
}];
}
}
В таком случае какой-нибудь пользователь создать Facebook аккаунт и не очень его счет по электронной почте, когда он попытаться войти через мое приложение она показывает пустой экран после щелчка входа , никаких действий не будет. как я могу уведомить пользователя «Вы еще не подтвердили свою учетную запись FB», и он не возвращается в мое приложение. как я могу получить ответ оттуда?
Может ли кто-нибудь мне помочь?
Привет, пожалуйста, смотрите эту страницу, я добавляю экран шорты там http://stackoverflow.com/questions/20946555/facebook-login-via-app-with-unverified-user-account-in -fb – Rajesh
Почему вы не переключаете приложение в сафари, которое устраняет правильную проблему – Retro