0

I am using Facebook in my music application where user post comment on wall paper after listening the songs . So problem arises that user have to login again for next song. so please provide me code for session retains when he clicked on the tab where it written "keep me login".

Thanks

1 Answer 1

0

I have a file called FacebookHelper.m, here is the code there:

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

If you want to control the login dialog yourself, here is the code:

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

For your cases, I think you only need to get the session back and resume it.

9
  • thankx for u r answer but the problem is that the facebook dialog box opens automatically without clicking on the facebook icon
    – user390187
    Jul 14, 2010 at 9:55
  • What facebook dialog box? The code that I posted or your code? Can you show me some code. It is better
    – vodkhang
    Jul 14, 2010 at 9:58
  • publish page is open automatically after using above code foe session retain .Even you are providing to control login dialog
    – user390187
    Jul 19, 2010 at 6:30
  • yeah, it is just to control the login dialog. Which facebook dialog box are you talking about? I think you talked about facebook login diaglog box, right?
    – vodkhang
    Jul 19, 2010 at 6:38
  • yes, you are right but when i use 2nd part code then for the line "self.is dialogShown = yes; come error like "isDialogShown" is not structure or union. please help me to remove this error Secondly there is one warning 'FBDialogDelegate protocol' does not implemented by my controoler in which i used this code . so please help me
    – user390187
    Jul 19, 2010 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.