Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IOS Auth header Support #5347

Unanswered
mohammadfahadrao asked this question in Q&A
Discussion options

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

 mSocket = IO.socket(uri, IO.Options().apply {
 // Pass the authentication details using 'auth'
 auth = mutableMapOf<String, String>(
 "api_key" to "key here",
 "app_id" to "os-dev"
 )
 })

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.

const socket = io('https://backend.com', {
 auth:{
 api_key:'dddasdas',
 app_id:"stidev"
 }
});

This works on web version of my app and in react native android as well

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /