From 2c8bd503fc29a57babca7630ae21ea82c35b38b7 Mon Sep 17 00:00:00 2001 From: Heiner Lamprecht Date: Wed, 8 Jan 2020 12:07:46 +0100 Subject: [PATCH] Make sure, the parameter "port" is always treated as a number. --- package.json | 2 +- src/ios/SocketsForCordova/Classes/SocketPlugin.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e5c5c05..4cb72bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-socket-tcp", - "version": "1.6.0", + "version": "1.6.1", "description": "This Cordova plugin provides JavaScript API, that allows you to communicate with server through TCP protocol. Currently we support these platforms: iOS, Android, WP8.", "cordova": { "platforms": [ diff --git a/src/ios/SocketsForCordova/Classes/SocketPlugin.m b/src/ios/SocketsForCordova/Classes/SocketPlugin.m index f841310..9f7c844 100644 --- a/src/ios/SocketsForCordova/Classes/SocketPlugin.m +++ b/src/ios/SocketsForCordova/Classes/SocketPlugin.m @@ -26,7 +26,7 @@ NSString *socketKey = [command.arguments objectAtIndex:0]; NSString *host = [command.arguments objectAtIndex:1]; - NSNumber *port = [command.arguments objectAtIndex:2]; + NSNumber *port = [NSNumber numberWithInteger:[[command.arguments objectAtIndex:2] integerValue]]; NSLog(@"[NATIVE] OPEN socket for port: %@", port);