Xcode的Facebook登录错误CLOSED(Xcode facebook login erro

2019-09-22 11:26发布

您好我阅读和阅读这里的教程http://developers.facebook.com/ 。

关于到Facebook登录和发布应用程序,从进料,我的问题是我无法登录Facebook的根本。

我不能得到它的工作。 它吮吸,恼人的,并没有明确的教程/解释这个问题。

我试着从我的应用程序,在Safari中打开,然后将URL都喜欢去坚果闪烁登录..

我没有得到一个错误,为什么呢?

是否有任何明确的教程关于登录电子?

它的伟大工程模拟器上,而不是在设备上。

上的Xcode 4.5测试版即时通讯的权利,但它也不能在4.4工作。

我需要帮助!

[关闭]

编辑 :我定了! 我是如此愚蠢的......我挣扎七天刚刚登录到FB,然后我改变( 允许在设备上的Cookie),一切工作完美!

该死该设备只是需要一些饼干..大声笑

Answer 1:

我刚刚更新到最新的SDK FB大约2个星期前。 下面是我用同样的方式:

//FB recommends to put these two in the app delegate in their sample apps but you can place them other places
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
    NSArray *permissions = [NSArray arrayWithObjects:@"publish_actions", nil];
    return [FBSession openActiveSessionWithPermissions:permissions
                                          allowLoginUI:allowLoginUI
                                     completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                         NSLog((@"session.state is %d",session.state));
                                         if(session.state==513){
                                             [AppPrefererences sharedAppPrefererences].faceBookLoggedIn=YES;
                                             NSLog((@"facebookLogin pref has been set to yes from inside appDelegate"));
                                         }
                                         else{
                                             [AppPrefererences sharedAppPrefererences].faceBookLoggedIn=NO;
                                         }
                                     }];
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    // FBSample logic
    // We need to handle URLs by passing them to FBSession in order for SSO authentication
    // to work.
    return [FBSession.activeSession handleOpenURL:url];
}


    //Then whereever you want to initiate the log in (i use mine in a tableView)
      AppDelegate  *appDelegate =(AppDelegate*) [[UIApplication sharedApplication]delegate];

 if (![appDelegate openSessionWithAllowLoginUI:NO]) {
                    [appDelegate openSessionWithAllowLoginUI:YES];
                    facebookLoginLabel.text=@"Facebook Log Out";
                    [AppPrefererences sharedAppPrefererences].faceBookEnabled=YES;
                }
                else{
                    facebookLoginLabel.text=@"Facebook Log In";
                    [AppPrefererences sharedAppPrefererences].faceBookLoggedIn=NO;
                    [FBSession.activeSession closeAndClearTokenInformation];                    
                }

然后whererever您想发表你这样做:

  [FBRequestConnection startForPostStatusUpdate:@"any thing you want to post"
                                    completionHandler:^(FBRequestConnection *connection, id result, NSError *error){}];

同时,也不要忘记设置FBLoginViewDelegate

让我知道,如果你有任何问题! 希望能帮助到你!



文章来源: Xcode facebook login error CLOSED