0

我正在尝试在 Facebook 墙上发布链接。我的意思是我可以发布如下链接:http://domain.com,但我想做的是获取链接到 domain.com 的 TEXT。当然,Facebook 不允许这样做,因此发布的结果不会是 LINK,而是 LINK。

我在 Mashable iphone RSS 阅读器中看到了这种行为。结果是 FB 墙上的链接标题标题。

此外,在此应用程序中,用户会看到空白文本字段,并且在其下方有将作为链接发布在 FB 墙上的标题。在它下面有标准消息:sent over xxx iphone App。

所以我的问题是: 1. 如何在 FB 上发布链接(我必须在 ShareKit 中找到的 FB API 中更改什么) 2. 如何获取正在发布的内容的标题并将其放在 facebook 对话框视图中的文本字段下。

新鸿基Facebook.m

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\":\"%@\"\
                         }",


                         item.title == nil ? SHKEncodeURL(item.URL) : SHKEncode(item.title),
                         SHKEncodeURL(item.URL)
                         ];
    dialog.defaultStatus = [NSString stringWithFormat:@"%@ @ %@",item.title,[item.URL absoluteString]];

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



    [dialog show];

}

谢谢你看这个,L

4

1 回答 1

0

我对 ShareKit 不是很熟悉,因为我觉得它对于发布到 Facebook、Twitter 或电子邮件这样的简单任务来说太复杂了。因此我想出了我自己的库BMSocialShare。也许看看我的来源可以给你一个提示,告诉你用 ShareKit 做你想要实现的目标:https ://github.com/blockhaus/BMSocialShare/blob/dev/iOS/BMSocialShare/BMSocialShare/BMSocialShare.m

于 2012-05-17T14:26:09.307 回答