fbDidLogin never called (facebook-ios-sdk)

前端 未结 10 807
花落未央
花落未央 2020-12-20 05:09

I\'m using a pop up Facebook dialog for the user login and the publishing of a post on his/her stream

NSMutableDictionary* params = [NSMutableDictionary dict         


        
10条回答
  •  臣服心动
    2020-12-20 06:09

    The Mike Bretz method worked for me.

    I have a class (a view Controller) that has a button that does the following :

    NSMutableDictionary * params = [NSMutableDictionary dictionary];
    [params setObject:FACEBOOK_APP_ID forKey:@"client_id"];
    [[SHARED_APP facebook] setSessionDelegate:self];
    [[SHARED_APP facebook] dialog:@"oauth" andParams:params andDelegate:self];
    

    where my controller also conforms to the protocol FBSessionDelegate
    and SHARED_APP is my [[UIApplication sharedApplication] delegate]

    I implemented the method

    -(void)fbDidLogin {
        NSLog(@"fbDidLogin");
    }
    

    and it worked !

    I can then make subsequent calls to methods like

    [[SHARED_APP facebook] requestWithGraphPath:@"me/friends" andDelegate:self];
    

    to retrieve JSON data (with FBRequestDelegate) Be careful, for every request, to test the return value such as explained here http://developers.facebook.com/blog/post/500 to keep looking that you're still authenticated

    Hope it helps

提交回复
热议问题