0

当我达到最大字符数限制时,我无法发布我的网址。

最多 140 个字符,它工作正常。

从 130 个字符开始,当我开始编写链接时,我收到了消息

Link will appear shortened

但我无法点击Tweet Button。相反,我在屏幕顶部收到一条消息

Your Tweet was over 140 characters. You'll have to be more clever

我已经检查过这个链接

谢谢

4

1 回答 1

4
- (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
        }
    }];
}
于 2016-04-12T12:38:50.373 回答