简体   繁体   中英

Facebook SDK 3.5.1 doesn't open Facebook App on Facebook login

My app uses Facebook SDK 3.0. I don't have a Facebook account in iOS settings but I have an installed Facebook app on a device (iOS 6.1.3) and want to login to Facebook in my app. I call:

NSArray* aPermissions = [NSArray arrayWithObjects: @"user_about_me", @"user_activities", @"user_interests", @"user_notes" , @"read_stream", @"user_status",  @"user_likes" , @"friends_likes", @"user_hometown", @"user_location", @"email",  nil];
FBSession* session = [[FBSession alloc] initWithAppID:FACEBOOK_API_KEY
                                          permissions:aPermissions
                                      defaultAudience:FBSessionDefaultAudienceEveryone
                                      urlSchemeSuffix:nil
                                   tokenCacheStrategy:nil];

[session openWithBehavior: FBSessionLoginBehaviorUseSystemAccountIfPresent
                 completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
            [self connectResult:error withState:state];
        }];

And my app opens Facebook app and then it returns me back to my app. It's great, I like how it works.

But I found that Facebook has new SDK 3.5.1 and I decided to update my old SDK. And when I did it I found that this SDK doesn't open a Facebook app, it just presents a dirty WebView above a current view. This is terrible because user should remember his login and password. What can be wrong in my case? Did I miss something? Does Facebook disabled login through a Facebook app?

The code in these two cases are same.

It's from the fast app switching URLs thing. You probably have a fb$(FB_APP_ID) like url but it's declared as a second while the FB SDK looks only at the first resource: https://github.com/facebook/facebook-ios-sdk/blob/master/src/FBUtility.m#L381

This won't work 这行不通

This will work 这会起作用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM