如何在iphone的facebook上发布内容

时间:2010-02-20 08:55:22

标签: iphone facebook publish

我是iphone开发的新手。我创建了facebook应用程序,我已经显示了登录页面和发布页面。现在我想动态分享我的内容(标题和摘要)。

我不知道如何动态地提供内容,

这里我的代码和静态显示,它将发布。

但我想动态显示我的内容。

标题和摘要存储在可变数组中。          NSString * art;(存储标题)          NSString * summ; [存储摘要];

        fbAgent.shouldResumeSession =YES;
    [fbAgent publishFeedWithName:@"Sample"  
                     captionText:@"Test Application" 
                        imageurl:@"http://amanpages.com/wordpress/wpcontent/uploads/2009/12/logo2.png" 
                         linkurl:@"http://www.yahoo.com"
               userMessagePrompt:@"Share Something about this article" 
                     actionLabel:nil
                      actionText:@"Search Google"
                      actionLink:@"http://wwww.google.com"];

此示例代码并在网上下载。现在我想分享发布标题和摘要。

Plz帮助我,

2 个答案:

答案 0 :(得分:0)

使用fbagent,您不能仅发布标题+描述,您还必须提供图像链接和网页网址。

图片可以是您网站上存储的iPhone应用图标,网页网址可以是iPhone应用的appstore下载链接。

这将有助于推广和宣传您的应用。

所以,你可以做的最少是:

    fbAgent.shouldResumeSession = YES;
[fbAgent publishFeedWithName:art 
                         captionText:summ
                            imageurl:@"http://amanpages.com/wordpress/wp-content/uploads/2009/12/logo2.png" 
                             linkurl:@"http://amanpages.com/" 
                   userMessagePrompt:@"What do i think:"];

希望它有所帮助。

答案 1 :(得分:0)

请查看此示例:

NSMutableDictionary* params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                appId, @"api_key",
                                @"Happy Holi", @"message",
                                @"http://www.holifestival.org/holi-festival.html", @"link",
                                @"http://www.onthegotours.com/blog/wp-content/uploads/2010/08/Holi-Festival.png", @"picture",
                                @"Wanna Kno abt HOLI.. Check this...", @"name",
                                @"Wish u 'n' Ur Family, a Colourful day...", @"description",
                                                nil];

[facebook requestWithGraphPath:@"me/feed" andParams:params1 andHttpMethod:@"POST" andDelegate:self];

它会发布到你的墙上。如果你想发布到朋友墙,然后用[朋友脸书面UID]替换'我'。

[facebook requestWithGraphPath:@"1908979/feed" andParams:params1 andHttpMethod:@"POST" andDelegate:self];