0

我正在尝试编辑已记录的推文的“来源”字段:https ://dev.twitter.com/docs/platform-objects/tweets

下面的代码成功发布了一条推文,但是当我在 tweetdeck 上拉出这条推文时,它仍然说它是通过 ios 发布的。感觉 NSDictionary 不是编辑这个的地方,但是似乎流程中没有更好的地方,我找不到任何示例/文档来清理它。感谢您提前提供任何帮助。

NSDictionary *message = @{@"status": contents,
                          @"source": @"<a href=\"http://www.example.com\" rel=\"nofollow\">App Name</a>"};            
NSURL *requestURL = [NSURL
                                 URLWithString:@"http://api.twitter.com/1/statuses/update.json"];

SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter
                                    requestMethod:SLRequestMethodPOST
                                    URL:requestURL parameters:message];

postRequest.account = twitterAccount;
[postRequest performRequestWithHandler:^(NSData *responseData,
    NSHTTPURLResponse *urlResponse, NSError *error)
    {
                 NSLog(@"Twitter HTTP response: %i", [urlResponse 
                                                      statusCode]);
    }];          
4

1 回答 1

0

您所指的文档解释了返回字段的含义。

你不能自己设置源,没有API。

您可以在此处POST statuses/update找到API 。

此外,您发布的代码使用了不久前关闭的 API 版本 1。

现在您必须使用 API 版本 1.1。

于 2013-10-09T11:23:17.437 回答