[英]Facebook SDK 3.5.1 doesn't open Facebook App on Facebook login
My app uses Facebook SDK 3.0. 我的应用程序使用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.
我在iOS设置中没有Facebook帐户,但是我在设备(iOS 6.1.3)上安装了Facebook应用程序,并想在我的应用程序中登录Facebook。 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. 然后我的应用程序打开Facebook应用程序,然后将我返回到我的应用程序。 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. 但是我发现Facebook有新的SDK 3.5.1,因此我决定更新旧的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.
当我这样做时,我发现此SDK无法打开Facebook应用程序,而只是在当前视图上方显示脏的WebView。 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?
Facebook是否禁用通过Facebook应用程序登录?
The code in these two cases are same. 这两种情况下的代码是相同的。
It's from the fast app switching URLs thing. 这是来自快速应用程序切换URL的事情。 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
您可能有一个像url这样的fb $(FB_APP_ID),但它被声明为第二个,而FB SDK只看第一个资源: https : //github.com/facebook/facebook-ios-sdk/blob/master/src/ FBUtility.m#L381
This won't work 这行不通
This will work 这会起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.