Sharing hyperlink with facebook from iOS app

前端 未结 2 1202
一向
一向 2020-12-19 21:07

I am able to share text, picture and url with facebook using following code.

_lblTitle.text=@\"Joe just ran 3.10 miles on the Niagara Falls 5k in 24.53 with          


        
相关标签:
2条回答
  • 2020-12-19 21:42
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Sharing Tutorial", @"name",
                               @"Build great social apps and get more installs.", @"caption",
                               @"Allow your users to share stories on Facebook from your app using the iOS SDK.", @"description",
                               @"https://developers.facebook.com/docs/ios/share/", @"link",
                               @"http://i.imgur.com/g3Qc1HN.png", @"picture",
                               nil];
    

    You can make a dictionary like this and pass this to your function which will contain what exactly you want

    Or something like this

    FBShareDialogParams *params = [[FBShareDialogParams alloc] init];
    params.link = [NSURL URLWithString:@"https://developers.facebook.com/docs/ios/share/"];
    params.name = @"Sharing Tutorial";
    params.caption = @"Build great social apps and get more installs.";
    params.picture = [NSURL URLWithString:@"http://i.imgur.com/g3Qc1HN.png"];
    params.description = @"Allow your users to share stories on Facebook from your app using the iOS SDK.";
    
    0 讨论(0)
  • 2020-12-19 21:44

    After searching a lot I got the solution. This is possible only by Facebook Open Graph Story.

    You will have to create custom Story using Facebook Developer Website and integrate it properly with your ios app.

    Follow this link to create custom story.

    0 讨论(0)
提交回复
热议问题