How to connect Socket in Swift 4

前端 未结 3 1541
时光取名叫无心
时光取名叫无心 2021-02-06 16:26

I want to connect my app to the socket here is the code :-

  import UIKit
  import SocketIO

 class SocketIOManager: NSObject {
static let manager = SocketManage         


        
3条回答
  •  难免孤独
    2021-02-06 17:14

    Is your URL secured under HTTPS? If it is not, that could be the problem, due to App Transport Security restrictions.

    See Info Plist Reference

    See also this post here.

    If that's not the problem. I'd suggest to check if your Socket version on both sides, server and client, are the same. Recently I had a problem because of that.

    Hope it helps!

提交回复
热议问题