jjzjj

ios - Sharekit2.0 : how can I directly share to facebook and twitter, 而不是通过 UIActionSheet?

coder 2024-01-26 原文

我在一个项目上使用最新的Sharekit2.0。

列出了两个按钮(“在 Facebook 上投票”和“在 Twitter 上分享”)作为附件,因此我不需要 UIActionSheet 来提示。如何直接将文本信息分别分享到facebook和twitter。

谢谢

最佳答案

请您尝试以下操作:

#import "SHK.h"
#import "SHKFacebook.h"
#import "SHKTwitter.h"

然后是 Facebook

-(IBAction)forFacebook:(id)sender;{
    NSString *someText = @"This is a blurb of text I highlighted from a document.";
    SHKItem *item = [SHKItem text:someText];  

    [SHKFacebook shareItem:item];    

}

推特

-(IBAction)forTwitter:(id)sender;{
    NSString *someText = @"This is a blurb of text I highlighted from a document.";
    SHKItem *item = [SHKItem text:someText];  

    [SHKTwitter shareItem:item];    

}

请给我一个反馈,谢谢。

关于ios - Sharekit2.0 : how can I directly share to facebook and twitter, 而不是通过 UIActionSheet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13658163/

有关ios - Sharekit2.0 : how can I directly share to facebook and twitter, 而不是通过 UIActionSheet?的更多相关文章

随机推荐