triniwiz / nativescript-socketio

Socket.IO for nativescript
Apache License 2.0
71 stars 31 forks source link

socketIO don't connect to server on IOS #46

Closed juanitozambada closed 6 years ago

juanitozambada commented 7 years ago

I can't do a connection to server when the platform is IOS but on android with the same code I can get the connection.

    "tns-ios":   "version": "3.2.0"

    "nativescript-socketio": "^2.4.0",

I got the message when I add the ios platform:

platforms/ios/Pods/Socket.IO-Client-Swift/Source/WebSocket.swift:118:28: warning: when calling this function in Swift 4 or later, you must pass a '()' tuple; did you mean for the input type to be '()'? public var onConnect: ((Void) -> Void)? ^~ ()

juanitozambada commented 7 years ago

@triniwiz I was able to connect to the server. To achieve this, I had to include the following lines on the info.plist file:

NSAppTransportSecurity NSAllowsArbitraryLoads I think you should include this information for your users. However, now I have the problem that I can not use namespaces on socketio. You use socket.io-client-swift version 9.0.1 and to use namespaces you need to use: socket.io-client-swift version 12.1.1 or higher. Can you do it for the users of the plugin nativescript-socketio? I would appreciate it very much.
juanitozambada commented 7 years ago

@triniwiz I was able to connect to the server. To achieve this, I had to include the following lines on the info.plist file:

NSAppTransportSecurity NSAllowsArbitraryLoads I think you should include this information for your users. However, now I have the problem that I can not use namespaces on socketio. You use socket.io-client-swift version 9.0.1 and to use namespaces you need to use: socket.io-client-swift version 12.1.1 or higher. Can you do it for the users of the plugin nativescript-socketio? I would appreciate it very much.
juanitozambada commented 7 years ago
       <key> NSAppTransportSecurity </key>
       <dict>
                   <key> NSAllowsArbitraryLoads </key>
                   <true/>
       </dict>
triniwiz commented 7 years ago

@juanitozambada I'm currently upgrading the plugin