2012-04-10 22 views
0

添付ファイルを使用してFacebookに共有しています。添付ファイル名(名前は表示されますが、URLではありません)に関連付けられたURLを除き、これはこれを行う「古い」方法ですが、「新しい」方法はまったく同じ結果をもたらします。 URLを参照する際には、linkとhref(2つの異なる場所)の両方を使用する必要がありました。興味深いのは、名前のURLとイメージのhrefのURLが同じ場合、すべてが機能するということです。すべてのフィールド/ URLが有効です。ありがとう。名前のURLがFacebookの添付ファイルでは機能していません。添付ファイル

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

NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
                APP_GET, @"text", 
                APP_URL, @"href", 
                nil], nil]; 

Mix *currentMix = [MixPlayer sharedPlayer].currentMix; 

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; 

NSDictionary* imageShare = [NSDictionary dictionaryWithObjectsAndKeys: 
          @"image", @"type", 
          currentMix.coverURL, @"src", 
          currentMix.mixUrl, @"href", 
          nil]; 

NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: 
          currentMix.title, @"name", // this won't appear as a URL 
          @"company.com", @"caption", 
          currentMix.description, @"description", 
          currentMix.mixUrl, @"link", // "href" breaks the attachment 
          [NSArray arrayWithObjects:imageShare, nil], @"media", 
          nil]; 

NSString *attachmentStr = [jsonWriter stringWithObject:attachment]; 

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           kAppId, @"api_key", 
           @"Share on Facebook", @"user_message_prompt", 
           actionLinksStr, @"action_links", 
           attachmentStr, @"attachment", 
           nil]; 

[[delegate sharedFacebook] dialog:@"stream.publish" andParams:params andDelegate:delegate]; 

答えて

0

あなたはレイのサイトを見ましたか?このリンクはold wayです。このリンクは新しいものですgraph api

関連する問題