Soni
Soni

Reputation: 454

Facebook Graph API sharing Link

I want to share a link using Facebook Graph API. I am doing following.

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                    @"Description goes here.",@"description",
                                   @"www.google.com/image.jpg",@"picture",
                                   @"www.google.com/invites/username", @"link",
                                   @"Google",@"name",
                                   @"www.google.com",@"caption",
                                   nil];


    Facebook *fb = [Model shared].facebook;

    [fb requestWithGraphPath:@"me/links" andParams:params andHttpMethod:@"POST" andDelegate:self];

and I want the FB Post to be like this: enter image description here

But what I 've learned is that Facebook Graph API takes the image and the description by itself from the shared page.

Is there any way to customize the content that you want to share?

Upvotes: 3

Views: 5683

Answers (1)

Juicy Scripter
Juicy Scripter

Reputation: 25938

If you post link Facebook get OpenGraph tags (like picture and description) from page located on URL you specify as link.

Using Graph API by publishing post object instead of link allow you to specify custom info.

Actually to achieve this you can just change me/links to me/feed:

[fb requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

Upvotes: 4

Related Questions