diff --git a/Source/VPSocketEngine.m b/Source/VPSocketEngine.m index 9f77b1b..65943e4 100644 --- a/Source/VPSocketEngine.m +++ b/Source/VPSocketEngine.m @@ -226,11 +226,22 @@ -(void) createURLs urlPollingComponent.scheme = @"http"; } - for (NSString *key in _connectParams.allKeys) { - NSString *value = _connectParams[key]; + for (id key in _connectParams.allKeys) { NSString *encodedKey = [key urlEncode]; - NSString *encodedValue = [value urlEncode]; - [queryString appendFormat:@"&%@=%@", encodedKey, encodedValue]; + id value = _connectParams[key]; + if([value isKindOfClass:[NSString class]]) { + NSString *encodedValue = [(NSString*)value urlEncode]; + [queryString appendFormat:@"&%@=%@", encodedKey, encodedValue]; + } + else if([value isKindOfClass:[NSArray class]]){ + NSArray *array = value; + for (id item in array) { + if([item isKindOfClass:[NSString class]]) { + NSString *encodedValue = [item urlEncode]; + [queryString appendFormat:@"&%@=%@", encodedKey, encodedValue]; + } + } + } } urlWebSocketComponent.percentEncodedQuery = [NSString stringWithFormat:@"transport=websocket%@",queryString]; diff --git a/VPSocketIO.podspec b/VPSocketIO.podspec index 86c0a70..b45a453 100644 --- a/VPSocketIO.podspec +++ b/VPSocketIO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "VPSocketIO" - s.version = "1.0.4" + s.version = "1.0.5" s.summary = "Socket.IO client for iOS" s.description = <<-DESC Socket.IO-client for iOS.