facebook 提供了以下代码来发布到页面上,但是考虑到 facebook 已转移到 FBSDKGraphRequest v2.6,我无法找到该代码的快速版本
NSDictionary *params = @{
@"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
最佳答案
这样就完成了工作
let request = FBSDKGraphRequest(graphPath: "page-id/feed", parameters: ["Message" : "Hello there"], HTTPMethod: "POST")
request.startWithCompletionHandler { (connection, result, error) in
//Handle the request
}
您可以根据需要设置参数。在这里阅读有关参数的信息:FBSDK
在此处了解更多信息:Facebook
关于swift - ios swift 2 代表该页面在 facebook 页面上发帖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36679626/