how to tweet url in twitter in iphone
When I reached the maximum character limit, I can't tweet my url.
Up to 140 character it works fine.
From 130 characters, when I started to write the link, I get the message
Link will appear shortened
but I can't click on Tweet Button
. Instead, I get a message at the top of screen
Your Tweet was over 140 characters. You'll have to be more开发者_高级运维 clever
I have already check this link
Thanks
- (void)postOnTwitter
{
// You can take url with any length....
NSString *shareLink = @"https://www.google.co.in/"
// text should be under 140 character size
// TEXT MUST BE END WITH "." dot.
NSString *text = @"Heyyy... I am sharing Url with any length."
NSString *tweetStr = [NSString stringWithFormat:@"%@ %@",text, shareLink];
NSMutableDictionary *message = [[NSMutableDictionary alloc] initWithObjectsAndKeys:tweetStr,@"status", nil];
NSURLRequest* request = [[[Twitter sharedInstance] APIClient] URLRequestWithMethod:@"POST" URL:@"https://api.twitter.com/1.1/statuses/update.json" parameters:message error:nil];
[[[Twitter sharedInstance] APIClient] sendTwitterRequest:request completion:^(NSURLResponse* response, NSData* data, NSError* error){
if(!error)
{
// Post successfully
}
else if(error)
{
// Check for Error
}
}];
}
精彩评论