Search code examples
objective-ciossharekit

Sharekit not populating facebook text box


Here is the code I use. I am able to see popup but I do not see the text pre-populated in the facebook popup.

Any suggestions?

- (IBAction) shareViaFacebook
{

    [self prepareToShare];

    // create the item to share
    NSString *share = [NSString stringWithFormat:@"I'm tracking %@ in some stuff, check it out! http://somewebsite.com/g/%d @TEST", 
                       self.game.name, 
                       [self.game.serverId intValue]];

    SHKItem *item = [SHKItem text:share];

    // share the item
    [SHKFacebook shareItem:item];
}

On the same age, the following code for twitter works just fine. That is everything gets prepopulated

- (IBAction) shareViaTwitter
{
    [self prepareToShare];

    // create the item to share
  NSString *share = [NSString stringWithFormat:@"I'm tracking %@ in some stuff, check it out! http://somewebsite.com/g/%d @TEST", 
                           self.game.name, 
                           [self.game.serverId intValue]];

    SHKItem *item = [SHKItem text:share];

    // share the item
    [SHKTwitter shareItem:item];
}

Solution

  • This is an example from my project using ShareKit:

    NSString *finalPostedString = [[NSString alloc] initWithFormat:@"Check out this"];
    SHKItem *item1= [SHKItem text:finalPostedString];   
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item1];
    [actionSheet showInView:self];
    

    Try that out and hopefully it helps.

    EDIT: Or more specifically, check this thread out that also should answer your question: iPhone/iOS - How to use "ShareKit" to post only to Facebook or only to Twitter