gpt4 book ai didi

iphone - Facebook 分享仅发布在我的墙上,而不是我 friend 的墙上 - ios

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

我打算在 Facebook 上发布(图像、字符串或链接)。当我尝试使用以下代码发布时,它仅发布在我的墙上,而不显示在我的 friend 墙上。

权限:

“read_stream”、“publish_stream”、“电子邮件”、“user_birthday”、“friends_about_me”、“friends_activities”、“friends_likes”。

 - (IBAction)fblogin:(id)sender {

AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

getdelegate.facebook.sessionDelegate=self;

Reachability *reachability = [Reachability reachabilityForInternetConnection];

NetworkStatus internetStatus = [reachability currentReachabilityStatus];



if (internetStatus != NotReachable) {

if([getdelegate.facebook isSessionValid])

{

NSLog(@"User already logined with facebook");

}

else

{

[getdelegate.facebook authorize:[NSArray arrayWithObjects:@"read_stream",@"publish_stream",@"email",@"user_birthday",@"friends_about_me",@"friends_activities",@"friends_likes",nil]];

}

}

else

{

NSLog(@"No Internet Connection");

}

}



- (void)fbDidLogin

{

AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

[getdelegate.facebook requestWithGraphPath:@"me" andDelegate:self];

}



- (void) request:(FBRequest*)request didLoad:(id)result

{

AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

if ([result isKindOfClass:[NSDictionary class]])

{


}
}



- (IBAction)Sharebutton:(id)sender

{

AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

NSLog(@"TOKEN:%@",getdelegate.facebook.accessToken);



NSURL *url = [NSURL URLWithString:@"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg"];

NSData *data = [NSData dataWithContentsOfURL:url];

UIImage *img= [[UIImage alloc] initWithData:data];

NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:img,@"picture",@"http://www.google.com",@"link",@"Message text",@"message",nil];

[[getdelegate facebook] requestWithGraphPath:@"me/feed"

andParams:params

andHttpMethod:@"POST"

andDelegate:self];



}

我做错了什么?

最佳答案

阅读 Facebook 方法中更改的此链接

https://developers.facebook.com/roadmap/completed-changes/

IdOfFriend/Feed 方法不再起作用

阅读以获得更多帮助:

https://developers.facebook.com/docs/howtos/ios-6/

关于iphone - Facebook 分享仅发布在我的墙上,而不是我 friend 的墙上 - ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15130433/

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