Index: webrtc/examples/objc/AppRTCDemo/ARDCEODTURNClient.m |
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDCEODTURNClient.m b/webrtc/examples/objc/AppRTCDemo/ARDCEODTURNClient.m |
index 70f815a6a8bf9457961eab19fe34a55e830aaebd..af79b4a1b40d542ed8a6eb7f904f7f7ebd99ac7e 100644 |
--- a/webrtc/examples/objc/AppRTCDemo/ARDCEODTURNClient.m |
+++ b/webrtc/examples/objc/AppRTCDemo/ARDCEODTURNClient.m |
@@ -11,7 +11,7 @@ |
#import "ARDCEODTURNClient.h" |
#import "ARDUtilities.h" |
-#import "RTCICEServer+JSON.h" |
+#import "RTCIceServer+JSON.h" |
// TODO(tkchin): move this to a configuration object. |
static NSString *kTURNOriginURLString = @"https://apprtc.appspot.com"; |
@@ -30,8 +30,8 @@ static NSInteger kARDCEODTURNClientErrorBadResponse = -1; |
return self; |
} |
-- (void)requestServersWithCompletionHandler: |
- (void (^)(NSArray *turnServers, |
+- (void)requestServerWithCompletionHandler: |
+ (void (^)(RTCIceServer *turnServer, |
NSError *error))completionHandler { |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_url]; |
// We need to set origin because TURN provider whitelists requests based on |
@@ -42,24 +42,23 @@ static NSInteger kARDCEODTURNClientErrorBadResponse = -1; |
completionHandler:^(NSURLResponse *response, |
NSData *data, |
NSError *error) { |
- NSArray *turnServers = [NSArray array]; |
if (error) { |
- completionHandler(turnServers, error); |
+ completionHandler(nil, error); |
return; |
} |
NSDictionary *dict = [NSDictionary dictionaryWithJSONData:data]; |
- turnServers = [RTCICEServer serversFromCEODJSONDictionary:dict]; |
- if (!turnServers) { |
+ RTCIceServer *turnServer = [RTCIceServer serverFromCEODJSONDictionary:dict]; |
+ if (!turnServer) { |
NSError *responseError = |
[[NSError alloc] initWithDomain:kARDCEODTURNClientErrorDomain |
code:kARDCEODTURNClientErrorBadResponse |
userInfo:@{ |
NSLocalizedDescriptionKey: @"Bad TURN response.", |
}]; |
- completionHandler(turnServers, responseError); |
+ completionHandler(turnServer, responseError); |
return; |
} |
- completionHandler(turnServers, nil); |
+ completionHandler(turnServer, nil); |
}]; |
} |