简体   繁体   中英

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.

In the meantime, you can add that function to your current version of MGTwitterEngine by referencing this variant of 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];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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