简体   繁体   English

如何在iPhone Twitter应用程序(MGTwitterEngine)上进行RETWEET

[英]How to do a RETWEET on an iPhone twitter app (MGTwitterEngine)

如何在iPhone Twitter应用程序(MGTwitterEngine)上进行RETWEET

It seems that this function hasn't supported in mattgemmell / MGTwitterEngine yet. 看来mattgemmell / MGTwitterEngine还不支持此功能。

In the meantime, you can add that function to your current version of MGTwitterEngine by referencing this variant of MGTwitterEngine: freeatnet / MGTwitterEngine 同时,您可以通过引用以下MGTwitterEngine的变体将该功能添加到当前版本的MGTwitterEngine中: freeatnet / MGTwitterEngine

- (NSString *)sendRetweet:(unsigned long)updateID
{
  if (updateID == 0){
    return nil;
  }
  NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];

  return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path 

                        queryParameters:nil body:nil 
                            requestType:MGTwitterUpdateSendRequest
                           responseType:MGTwitterStatus];
}
- (NSString *)sendRetweet:(unsigned long)updateID

{
    if (updateID == 0){

        return nil;
    }

    NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
        [params setObject:[NSString stringWithFormat:@"%@", updateID] forKey:@"id"];
        NSString *body = [self _queryStringWithBase:nil parameters:params prefixed:NO];


    return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path 
                        queryParameters:params body:body 
                            requestType:MGTwitterUpdateSendRequest
                           responseType:MGTwitterStatus];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM