如何发布给朋友墙使用Facebook Graph API for iPhone [英] How to post to a friends Wall using Facebook Graph API for iPhone

查看:96
本文介绍了如何发布给朋友墙使用Facebook Graph API for iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在用户的朋友墙上发布一些内容。



我用它来发布到用户墙上

  SBJSON * jsonWriter = [[SBJSON new] autorelease]; 

NSDictionary * actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@Always running,@text,@http://itsti.me/,@href ,nil],nil];

NSString * actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary * attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@a long run,@name,
@Facebook Running app,@caption,
@ 这很有趣,@description,
@http://itsti.me/,@href,nil];
NSString * attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@在Facebook上分享,@user_message_prompt,
actionLinksStr,@action_links,
attachmentStr,@附件零];

[Facebook对话框:@feed
andParams:params
andDelegate:self];

但我需要在我的朋友墙上张贴。我如何做到这一点



在这个 post 他们提到过关于targetId我需要做的事情。

解决方案>

您是否尝试使用

  [facebook requestWithGraphPath:@[friend_ID] / feedandParams:params andHttpMethod: @POSTandDelegate:self]; 

更新:



在朋友墙上发帖不会再用Graph API了。相反,您必须使用FBDialog。


I want to post something in the users friends wall.

I use this to post into the user wall

SBJSON *jsonWriter = [[SBJSON new] autorelease];

    NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                           @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];

    NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
    NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"a long run", @"name",
                                @"The Facebook Running app", @"caption",
                                @"it is fun", @"description",
                                @"http://itsti.me/", @"href", nil];
    NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"Share on Facebook",  @"user_message_prompt",
                                   actionLinksStr, @"action_links",
                                   attachmentStr, @"attachment",nil];

    [facebook dialog:@"feed"
            andParams:params
          andDelegate:self];

But i need to post in my friends wall. how can i do this

In this post they have mentioned about targetId do i have to do something with that.

解决方案

Have you tried using,

[facebook requestWithGraphPath:@"[friend_ID]/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

UPDATE:

Posting on friends wall will no more work with Graph API. Instead you must use FBDialog.

这篇关于如何发布给朋友墙使用Facebook Graph API for iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆