How to Share image + text with facebook in swift iOS?

匆匆过客 提交于 2019-12-12 01:59:59

问题


I am writing facebook interaction code in swift language for iOS. I have converted login and other code but stuck with sharing methods.

I am not able to find requestWithGraphPath method of FBRequest class in swift. If somebody know about this then please help me here. I have searched for solution on web but fail to find.

This is my sharing code in Objective-C

 FBRequest *req=[FBRequest requestWithGraphPath:@"me/feed" parameters:params HTTPMethod:@"POST"];
    [req startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error{
        if (!error) {
            // Sucess! Include your code to handle the results here                
            NSLog(@"Successful sharing");
        } else {
            // An error occurred, we need to handle the error
            // See: https://developers.facebook.com/docs/ios/errors
            NSLog(@"Error while sharing data");
        }
    }];

Thank you in advance.

来源:https://stackoverflow.com/questions/26602421/how-to-share-image-text-with-facebook-in-swift-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!