I want to post text(on twitter, fb, mail) like following using share kit:
Hi,
This is share text
Click here to do something <=== this should be a link
Click here to another something <=== this should be a link
Cheers
I have following code:
-(IBAction)shareOnTwitter:(id)sender
{
[SHK setRootViewController:self];
SHKItem *item;
NSURL *url = [NSURL URLWithString:@"http://dosomething.com"];
item = [SHKItem URL:url title:@"HI,\n\nThis is share text\n\nCheers"];
[SHKTwitter shareItem:item];
}
- (IBAction)shareOnFacebook:(id)sender
{
SHKItem *item;
NSURL *url = [NSURL URLWithString:@"http://dosomething.com"];
item = [SHKItem URL:url title:@"HI,\n\nThis is share text\n\nCheers"];
[SHKFacebook shareItem:item];
}
- (IBAction)shareWithMail:(id)sender
{
SHKItem *item;
NSURL *url = [NSURL URLWithString:@"http://dosomething.com"];
item = [SHKItem URL:url title:@"HI,\n\nThis is share text\n\nCheers"];
[SHKMail shareItem:item];
}
But the url is appended at the end. How can I add multiple links with my text and bring the links in the middle.
You will have to change the ShareKit classes that handle these services:
It’s easy for Twitter and Mail, you only have to create a NSString with the text of the message, like you want. With Facebook you have to change the attachment, you can see the facebook API here for more options.