2

組み込みの iOS 5 Twitter フレームワークと TwitVid SDK を使用して、ビデオを Twitter にアップロードしようとしています。

私が取っている手順:

1) TWRequest を使用して、署名付きの要求を取得します。

ACAccountStore *accountStore = [[ACAccountStore alloc] init];

[accountStore requestAccessToAccountsWithType:[accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter] withCompletionHandler:^(BOOL granted, NSError *error) {
    if(error) {
        [[[UIAlertView alloc] initWithTitle:@"Sorry!" message:[error description] delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles: nil] show];
    }
    else if (granted) {
        NSArray *arrayOfAccounts = [accountStore accountsWithAccountType:[accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]];
        if ([arrayOfAccounts count] > 0) {
            ACAccount *account = [arrayOfAccounts objectAtIndex:0];

            NSURL *spURL = [NSURL URLWithString:@"https://api.twitter.com/1/account/verify_credentials.json"];
            TWRequest *twRequest = [[TWRequest alloc] initWithURL:spURL parameters:nil requestMethod:TWRequestMethodGET];
            [twRequest setAccount:account];
            NSURLRequest *signedURLRequest = [twRequest signedURLRequest];

2) TwitVid のインスタンスを作成し、アップロード リクエストを送信する

TwitVid *twitVid = [[TwitVid alloc] initWithSource:@"Test" delegate:self];
[twitVid uploadWithMediaFileAtPath:moviePath offset:0 message:@"Test Message" mediaID:nil playlistID:nil vidResponseParent:nil userTags:nil geoLatitude:nil geoLongitude:nil tags:nil categoryID:nil description:@"upload test" title:@"The title" xVerifyCredentialsAuthorization:[signedURLRequest valueForHTTPHeaderField:@"Authorization"] xAuthServiceProvider:[spURL absoluteString]];

初めてこれを行ったとき、適切なデリゲート メソッドからエラーが返され、署名の問題であると想定しました (コードにいくつかのバグがありました)。今、私が何をしても、どのデリゲート メソッドでも何も得られません。データを送信していない、応答が受信されていない - 何もない。私は何をすべきか途方に暮れています。何か案は?

4

0 に答える 0