1

MGTwitterEngine を使用しています。MGTwitterEngine の現在のバージョンに対する変更を示すこの投稿を見つけました。

この変更を適用しました。メソッドを実行すると、次のように返されます。

2012-04-10 01:04:17.908 Otsuka On[27519:707] INFO -> retweet response: 07695198-2526-4FF4-BC46-8D39F7719836

しかし、Twitter アカウントのタイムラインでは何も起こりません。

TwitterEngine に追加されたメソッドは次のとおりです。

- (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:@"%u", 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];
}

誰が私が間違っているのか知っていますか?

ありがとう。

4

2 に答える 2

3

私は次の方法を使用していますが、それは私にとってはうまくいきます:

- (NSString *)sendRetweet:(MGTwitterEngineID)tweetID {    
    NSString *path = [NSString stringWithFormat:@"statuses/retweet/%llu.%@", tweetID,     API_FORMAT];

    return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path 
                        queryParameters:nil body:nil 
                            requestType:MGTwitterRetweetSendRequest
                           responseType:MGTwitterStatus];

}

更新: はい、このフォークを使用してみてください: github.com/mattgemmell/MGTwitterEngine

于 2012-04-10T08:31:40.490 に答える
1

最後に、NSString パラメータを updateID として使用して問題を解決しました。

- (NSString *)sendRetweet:(NSString *)updateID
{

    NSString *path = [NSString stringWithFormat:@"statuses/retweet/%@.%@", 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];
}
于 2012-04-16T11:36:13.953 に答える