iPhone/iOS - How to use “ShareKit” to post only to Facebook or only to Twitter

后端 未结 3 436
一个人的身影
一个人的身影 2020-12-08 07:51

In my iPhone app, I have two two buttons, labeled \"Facebook\" and \"Twitter\". I want to use the Sharekit framework which makes my sharing very simple. But as shown in the

3条回答
  •  难免孤独
    2020-12-08 08:38

    Sharekit provides a generic sharing mechanism but also exposes individual services. For instance, if you were to share a URL on twitter, you could write the following code:

    #import "ShareKit/Core/SHK.h"
    #import "ShareKit/Sharers/Services/Twitter/SHKTwitter.h"
    
    ...
    
    SHKItem *item = [SHKItem URL:url title:@"A title"];
    [SHKTwitter shareItem:item];
    

    This is all explained in the documentation, but don't fear exploring the header files of the individual services.

提交回复
热议问题