sharekit - 在墙上发布链接

发布于 2024-10-23 13:52:23 字数 1495 浏览 1 评论 0原文

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

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

此外,在此应用程序中,用户会看到空文本字段,其下方有一个标题,该标题将作为链接发布在 FB 墙上。在它下面有标准消息:通过 xxx iphone 应用程序发送。

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

SHKFacebook.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

I'm trying to post a link on the facebook wall. I mean I can post a link like: http://domain.com, but what I want to do is to get TEXT that is link to domain.com.
Facebook, of course, doesn't allow this so the published result won't be LINK but LINK.

I saw this behaviour in Mashable iphone RSS reader. Result is linked title title on FB wall.

Also, in this application user is presented with empty text field and under it there is the title that will be published as a link on FB wall. Under it there is standard message:sent over xxx iphone App.

So my questions are:
1. how to publish link on FB (what do I have to change in FB API found in ShareKit)
2. how to grab title of what's being published and put it under text field in the facebook dialog view.

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

}

Thank you for taking look at this,
L

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

A君 2024-10-30 13:52:23

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

I am not that familiar with ShareKit as I felt it was too complex for a simple task like posting to Facebook, Twitter or Email. Therefore I came up with my own lib BMSocialShare. Maybe taking a look at my source can give you a hint on doing what you are trying to achieve with ShareKit: https://github.com/blockhaus/BMSocialShare/blob/dev/iOS/BMSocialShare/BMSocialShare/BMSocialShare.m

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文