[英]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. 最多140个字符,可以正常工作。
From 130 characters, when I started to write the link, I get the message 从130个字符开始写链接时,我收到消息
Link will appear shortened
but I can't click on Tweet Button
. 但我无法点击“
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
}
}];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.