views:

45

answers:

1

Hi

Is it possible to start an FB session in an iPhone app without using the FBLoginButton? I would like to let the user login when they click on a table row.

Thanks.

A: 

yes, it is possible. It is the way I do:

I have a class called FacebookHelper:

- (id)init {
    if (self = [super init]) {
        session_ = [[FBSession sessionForApplication:kAPIKey secret:kApplicationSecret delegate:self] retain];
        [session_ resume];      
    }
    return self;
}

- (void)loginByShowingDialog {
    self.isDialogShown = YES;
    FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:self.session] autorelease];
    dialog.delegate = self;
    [dialog show];
}

First, you init an instance of Facebook Helper then call loginByShowingDialog, then everything just works by handling delegate

vodkhang
Thanks. Will give this a try.
lostInTransit