[英]Facebook share posted only in my wall not in my friends wall - ios
I intended to post (Image or String or Link) in Facebook. 我打算在Facebook中发布(图片,字符串或链接)。 When i tried to post with the following code it is only posting in my wall, not showing in my friends wall.
当我尝试使用以下代码发布时,它仅发布在我的墙上,而不显示在我的朋友墙上。
Permission : 权限:
"read_stream","publish_stream","email","user_birthday","friends_about_me","friends_activities","friends_likes". “ read_stream”,“ publish_stream”,“ email”,“ 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];
}
What have i done wrong? 我做错了什么?
Read this link changed in Facebook Methods 阅读此链接在Facebook方法中更改
https://developers.facebook.com/roadmap/completed-changes/ https://developers.facebook.com/roadmap/completed-changes/
IdOfFriend/Feed method wont work anymore IdOfFriend / Feed方法不再起作用
Read it for more help: 阅读以获得更多帮助:
https://developers.facebook.com/docs/howtos/ios-6/ https://developers.facebook.com/docs/howtos/ios-6/
[[getdelegate facebook] requestWithGraphPath:@"me/feed"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
instead of "me/feed" you have to provide the facebook id of the friend on whose wall you want to share. 而不是“我/饲料”,您必须提供您要分享的朋友的Facebook ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.