2011-09-14 14 views
0

私はあなたに私の問題を説明します。
私はFacebookのURLを共有する私のiPhoneアプリでSharekitを使用しています。
私は自分のURLを共有することができますが、説明のセクションには何もありません(空白のフィールドのみ)。
と私はいくつかのテキストを書いています。iPhoneでsharekitを使用してFacebookに説明を追加

私は、メソッドの送信中に私のファイルSHKFacebbok.mでこのコードを使用しています:誰かが私は、URLの説明を書くことができる方法を知っている

if (item.shareType == SHKShareTypeURL) 
{ 
    self.pendingFacebookAction = SHKFacebookPendingStatus; 
    SHKFBStreamDialog* dialog = [[[SHKFBStreamDialog alloc] init] autorelease]; 
    dialog.delegate = self; 

    dialog.userMessagePrompt = SHKLocalizedString(@"Votre réponse à cette question de merde:"); 
    dialog.attachment = [NSString stringWithFormat: 
         @"{\ 
         \"name\":\"%@\",\ 
         \"href\":\"%@\",\ 
         \"media\":[{\"type\":\"image\",\"src\":\"http://www.samanddon.com/qdm.png\",\"href\":\"http://itunes.apple.com/fr/app/qdm/id453225639?mt=8\"}]\ 
         }", 
         item.title == nil ? SHKEncodeURL(item.URL) : SHKEncode(item.title), 
         SHKEncodeURL(item.URL), 
         SHKEncodeURL(item.URL), 
         SHKEncodeURL(item.URL) 

         ]; 

    dialog.defaultStatus = item.text; 
    dialog.actionLinks = [NSString stringWithFormat:@"[{\"text\":\"Get %@\",\"href\":\"%@\"}]", 
          SHKEncode(SHKMyAppName), 
          SHKEncode(SHKMyAppURL)]; 
    [dialog show]; 

} 

dialog.attachment = [NSString stringWithFormat: 
           @"{\ 
           \"name\":\"%@\",\ 
           \"href\":\"%@\",\ 
           \"description\":\"%@\",\ 
           \"media\":[{\"type\":\"image\",\"src\":\"http://www.apple.com/images/an_image.png.png\",\"href\":\"http://www.apple.com/\"}]\ 
           }", 

           item.title == nil ? SHKEncodeURL(item.URL) : SHKEncode(item.title), 
           SHKEncodeURL(item.URL), 
           item.text 
           ]; 

注:説明は "\ nの" のような改行を持つことができません

答えて

0

はこれを試してみてください。それは私のために働いていない...それが助けて欲しい。

1

あまりにもこれを試してみてください。

NSString *picture; 
NSString *description; 


と新しい:SHKItem.hの==

if (item.shareType == SHKShareTypeURL) 
{ 
    self.pendingFacebookAction = SHKFacebookPendingStatus; 

    SHKFBStreamDialog* dialog = [[[SHKFBStreamDialog alloc] init] autorelease]; 
    dialog.delegate = self; 
    dialog.userMessagePrompt = SHKLocalizedString(@"Enter your message:"); 
    dialog.attachment = [NSString stringWithFormat: 
         @"{\ 
         \"name\":\"%@\",\ 
         \"href\":\"%@\",\ 
         \"description\":\"%@\",\ 
         \"media\":[{\"type\":\"image\",\"src\":\"%@\",\"href\":\"%@\"}]\ 
         }", 

         item.title == nil ? SHKEncodeURL(item.URL) : SHKEncode(item.title), 
         SHKEncodeURL(item.URL),item.description, item.picture,SHKEncodeURL(item.URL) 
         ]; 

    dialog.defaultStatus = item.text; 
    dialog.actionLinks = [NSString stringWithFormat:@"[{\"text\":\"Get %@\",\"href\":\"%@\"}]", 
          SHKEncode(SHKMyAppName), 
          SHKEncode(SHKMyAppURL)]; 
    [dialog show]; 

} 


==は、新しいアイテムを追加SHKFacebook.mの==で
==をプロパティ:

==

SHKItem *item = [SHKItem URL:yoururl title:yourtitle description:yourdesc picture:yourpicture]; 
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 
[actionSheet showFromToolbar:self.navigationController.toolbar]; 

チアーに使用する方法SHKItem.mの==

+ (SHKItem *)URL:(NSURL *)url 
{ 
    return [self URL:url title:nil description:nil picture:nil]; 
} 

+ (SHKItem *)URL:(NSURL *)url title:(NSString *)title description:(NSString *)description picture:(NSString *)picture 
{ 
    SHKItem *item = [[SHKItem alloc] init]; 
    item.shareType = SHKShareTypeURL; 
    item.URL = url; 
    item.title = title; 
    item.description = description; 
    item.picture = picture; 

    return [item autorelease]; 
} 


オン


== ==! :D

関連する問題