2

私は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"];

このサンプルコードは、ネットでダウンロードします。今、タイトルと要約を公開するために共有したいと思います。

助けてください、

4

2 に答える 2

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

それはあなたの壁に公開されます。友達のウォールに公開したい場合は、「me」を[friendfacebookUID]に置き換えてください。

[facebook requestWithGraphPath:@"1908979/feed" andParams:params1 andHttpMethod:@"POST" andDelegate:self];
于 2011-03-23T07:33:24.590 に答える
0

fbagentを使用して、タイトルと説明のみを公開することはできません。画像へのリンクとWebページのURLも提供する必要があります。

画像はサイトに保存されているiPhoneアプリのアイコンにすることができ、ウェブページのURLはiPhoneアプリのアプリストアダウンロードリンクにすることができます。

これは、アプリの普及と宣伝に役立ちます。

したがって、実行できる最小値は次のとおりです。

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

それが役に立てば幸い。

于 2010-02-21T07:30:23.467 に答える