开发者

How to publish the content in facebook of iphone

开发者 https://www.devze.com 2022-12-20 22:36 出处:网络
I am new to iphone development.I have created facebook application and i have displayed the login page and publish page. now i want to share my content(title and summary) display dynamically.

I am new to iphone development.I have created facebook application and i have displayed the login page and publish page. now i want to share my content(title and summary) display dynamically.

i dont know how to give the contents dynamically,

Here my code and display statically, it will published.

but i want to give my contents dynamically displayed.

titles and summaries are stored in the mutable arrays. NSString *art;(titles are stored) NSString *summ; [Summary are stored];

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

This sample code and downloaded in the net. now i want to shared to publish title and summary.

Plz help me out,


Using the fbagent, you cannot publish title+description only, you have to also provide a link to an image and a webpage url.

The image can be your iPhone app icon stored on your site and webpage url can be appstore download link of your iPhone app.

This will help popularize and advertise your app.

So, minimum you can do is:

    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:"];

Hope it helps.


just check this example:

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];

It will publish to your wall. If you want to publish to friends wall,then replace 'me' with [friend facebook UID].

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

精彩评论

暂无评论...
验证码 换一张
取 消