gpt4 book ai didi

ios - 如何在 iOS 中以 pageadmin 身份在 Facebook 页面上发布状态提要?

转载 作者:行者123 更新时间:2023-11-29 12:36:41 25 4
gpt4 key购买 nike

我想在我的 Facebook 页面上发布状态。状态应该在 Facebook 上显示为页面状态,而不是来自任何用户名或我的名字的状态。

我试过下面的代码,

 NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:@"This is a check for page post message", @"message", nil];

/* make the API call */
[FBRequestConnection startWithGraphPath:@"/1521177224766299/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error){
if (result)
{
NSLog(@"Result %@", result);
}
else
{
NSLog(@"%@", error);
}
}];

消息状态已发布完成页面墙,但该状态来 self 的名字。但是,当我尝试使用 page_id/feed POST 查询和相同的参数 @"this is my status"@"message"从 graph api explorer 页面点击相同的 post 方法时,它从不是我的页面发布状态。

请帮忙。

最佳答案

 NSString *accesstoken=[NSString stringWithFormat:@"%@","here add your page access_token"];

NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
accesstoken, @"access_token",
postingString, @"message",

// @"http://www.real-timesports.com", @"link",


nil];

FBRequest *requestToPost = [[FBRequest alloc] initWithSession:nil
graphPath:@"/me/feed"
parameters:params
HTTPMethod:@"POST"];


NSLog(@"requestToPost==%@",requestToPost);

FBRequestConnection *requestToPostConnection = [[FBRequestConnection alloc] init];
[requestToPostConnection addRequest:requestToPost completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{


NSLog(@"facebook result >> %@", result);


}];
[requestToPostConnection start];

关于ios - 如何在 iOS 中以 pageadmin 身份在 Facebook 页面上发布状态提要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26141394/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com