Publishing links to user's wall using Facebook iOS SDK

前端 未结 2 1266
长情又很酷
长情又很酷 2021-01-03 01:26

I\'m trying to publish a link to the user\'s wall on Facebook after he has already logged in using the new Facebook iOS SDK.

I want the link to behave as if the user

相关标签:
2条回答
  • 2021-01-03 01:53

    EDIT: The code below is for an OLD version of the FB SDK

    Check here for a more up to date answer that may help Facebook sdk post on wall on iPhone app

    OLD POST:

    From http://developers.facebook.com/docs/reference/dialogs/feed/

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
      kAppId, @"app_id",
      @"http://developers.facebook.com/docs/reference/dialogs/", @"link",
      @"http://fbrell.com/f8.jpg", @"picture",
      @"Facebook Dialogs", @"name",
      @"Reference Documentation", @"caption",
      @"Dialogs provide a simple, consistent interface for apps to interact with users.", @"description",
      @"Facebook Dialogs are so easy!",  @"message",
      nil];
    
    [_facebook dialog:@"feed" andParams:params andDelegate:self];
    
    0 讨论(0)
  • 2021-01-03 01:53

    You need to use FBStreamDialog for this. I do not have the exact code. Try this:

    FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.userMessagePrompt = @"What's in your mind?";
    dialog.attachment = @"{\"name\":\"Apple URL","
    "\"href\":\"http://www.apple.com\","
    "\"caption\":\"App Name\",\"description\":\"Posting link Test\","
    "\"media\":[{\"type\":\"image\","
    "\"src\":\"http://www.apple.com\","
    "\"href\":\"http://www.apple.com\"}],"
    "\"properties\":{\"another link\":{\"text\":\"Apple home page\",\"href\":\"http://www.apple.com\"}}}";
    [dialog show];
    
    0 讨论(0)
提交回复
热议问题