简体   繁体   中英

iOS Integration with Facebook - Publishing in the news feed

I don'y know if here is the right place to ask that, but i'm pretty sure that some of you already experienced some kind of iOS integration with Facebook.... Then I'll try to explain what i'm trying to do here....

I've already connected my app with facebook following the documentation in Developers.facebook..... The thing is.... I have a button in my app that should trigger the dialog box that allows me to publish in my news feed.... The problem is that the information in the documentation doesn't work (Or I don't know how to use it...)....

The orientation there is to use that code to trigger the action:

    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];

But that's a lot of things missing on the information, like: where should I use that code and how exactly....

Someone have already done that kind of thing?

Thanks!!!

The only thing you should do for this to work is make an IBAction an couple it in the Xib to the button and behaviour you want.

it would look something like this :

-(IBAction) sendMessageToWall
{
   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];

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM