Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 860
Soni Avatar asked Dec 05 '25 13:12

Soni


1 Answers

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];
like image 174
Juicy Scripter Avatar answered Dec 07 '25 17:12

Juicy Scripter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!