Twilioアカウントに関連付けられたすべての録音オブジェクトをダウンロードしようとしていますが、これを達成するTwilioVoiceClient.hまたはVoiceClient.hのメソッドは表示されません。私はProgramableVoice iOS SDK(ベータ5)を使用していますが、オンラインドキュメントには目的を表示していません。私は録音SIDがそうのように知られていれば問題なく個々の録画を再生することができるよ。私もやってみたい何プログラム可能な音声SDKを使用したTwilioのすべての録音の取得
NSString *baseString = @"https://api.twilio.com/2010-04-01/Accounts/";
NSString *recordingSID = @"RExxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
NSURL *recordingUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@/Recordings/%@.mp3", baseString, kTwilAccount, recordingSID]];
avPlayer = [[AVPlayer alloc]initWithURL:recordingUrl];
は、アカウントに関連付けられたすべての記録オブジェクトをダウンロードしています。このために、私はNSUrlConnectionになってきました:
NSString *baseStr = [NSString stringWithFormat:@"https://api.twilio.com/2010-04-01/Accounts/%@/Recordings.json", kTwilAccount];
NSURL *url = [NSURL URLWithString:baseStr];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:1000.0];
NSString *authStr = [NSString stringWithFormat:@"%@:%@", kTwilAccount, authToken];
NSData *authData = [authStr dataUsingEncoding:NSASCIIStringEncoding];
NSString *authValue = [NSString stringWithFormat:@"Base %@", [authData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]];
[theRequest setValue:authValue forHTTPHeaderField:@"Authorization"];
[NSURLConnection sendAsynchronousRequest:theRequest queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *responseCode, NSData *responseData, NSError *responseError) {
if ([responseData length] > 0 && responseError == nil){
// do work
} else if ([responseData length] == 0 && responseError == nil){
NSLog(@"data error: %@", responseError);
} else if (responseError != nil && responseError.code == NSURLErrorTimedOut){
NSLog(@"data timeout: %ld", (long)NSURLErrorTimedOut);
} else if (responseError != nil){
NSLog(@"data download error: %@", responseError);
}
}];
これは、コンソール出力でダウンロードエラーが発生:
データダウンロードエラー:エラードメイン= NSURLErrorDomainコード= -1012 "(ヌル)" のUserInfo = {NSErrorFailingURLStringKey = https://api.twilio.com/2010-04-01/Accounts/ACdee27262ef5fd27a593a697d80e7f7b0/Recordings.json、NSUnderlyingError = 0x17084aa70 {エラードメイン= kCFErrorDomainCFNetworkコード= -1012 "(ヌル)" のUserInfo = {_ kCFURLErrorAuthFailedResponseKey = {URL = https://api.twilio.com/2010-04-01/Accounts/ACdeedkfdjieireijrekjrkejrk4kj4/Recordings.json}}}、NSErrorFailingURLKey = https://api.twilio.com/2010-04-01/Accounts/ACdeedkfdjieireijrekjrkejrk4kj4/Recordings.json}明らか
、それがありませんかエンドポイントを認識するかどうか私が認証しているのと同じように。どのように私は客観的にこの情報を要求する必要がありますか?
読んでいただきありがとうございます。