Repository navigation
IOS Auth header Support #5347
Replies: 1 comment
|
Swift supports this. In your JavaScript example, let manager = SocketManager(socketURL: URL(string: "https://backend.com")!)
let socket = manager.defaultSocket
socket.connect(withPayload: [
"api_key": "your-api-key",
"app_id": "os-dev"
])Keep Those values reach the existing Node server as The API is documented here, and the released v16.1.1 client forwards the payload through the manager's CONNECT encoder. If your installed Swift package doesn't expose this method, check its version first. AI-assisted. Checked against the Swift source and an equivalent CONNECT packet sent to a local Socket.IO 4.8.1 server; this wasn't an iOS runtime test. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm using sockets in android to have a connection between backend(node js) app and my android app.
I'm successfully able connect to socket by passing auth header like
Since backend is expecting in auth.
this is working fine for android but on ios swift i'm unable to do so. I don't want to switch to query params as i'll have to change backend code and that is not in my reach.
Does swift not at all support auth header?
there is another web and react native example with which i was able to successfully connect.
This works on web version of my app and in react native android as well
All reactions