Question

Thanks for reading.

I went through Facebook iOS SDK Feed Dialog issue after authentication but in vain.

What works: I created a sample "Hello, World" app using the Facebook iOS Tutorial with the Feed Dialog. This tutorial works fine and I am able to see the post in my feed.

Problem: When I integrated this code in my app, I don't get to see the Feed Dialog after the authentication when the control reaches back to my app.

Flow of control: I have a UIImagePickerController showing a camera that takes a picture, then shows UIAlertView to indicate that the image is being uploaded, shows a UIAlertView to display the result returned from server, and then finally shows a UIActionSheet to display the different sharing options (share to Facebook, Twitter, etc.).

When the user hits "Share to Facebook", the following selector gets invoked:


- (void) initFacebook
{
    //Init Facebook
    facebook = [[Facebook alloc] initWithAppId:@"308136969223987" andDelegate:self];

    //Check for access_token 
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if([defaults objectForKey:@"FBAccessTokenKey"]
       && [defaults objectForKey:@"FBExpirationDateKey"]) {
        facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
        facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
    }

    if(![facebook isSessionValid]) {
        [facebook authorize:nil];
    }

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
  kAppId, @"app_id",
  @"https://developers.facebook.com/docs/reference/dialogs/", @"link",
  @"http://fbrell.com/f8.jpg", @"picture",
  @"Facebook Dialogs", @"name",
  @"Reference Documentation", @"caption",
  @"Using Dialogs to interact with users.", @"description",
  @"Facebook Dialogs are so easy!",  @"message",
  nil];

  [_facebook dialog:@"feed" andParams:params andDelegate:self];  
}

This launches the Facebook app to authenticate, and then opens my app again with the UIImagePickerController but doesn't show the Feed Dialog.

Can someone please help me out?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top