Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Websocket Connection open while App is in Background Mode #455

Closed
sarcasticposhy opened this issue Jan 20, 2018 · 3 comments
Closed

Comments

@sarcasticposhy
Copy link

As the title says, how am I able to keep the connection open and receive messages even when the app is in the background? Because now, everytime i set it to background or i lock my iPhone and unlock it, the websocket gets disconnected.

I've already found a solution and it says i should enable Voip in my Info.plist and then just do socket.voipEnabled = true, but it then says that Websocket does not have the member voipEnabled.

Does anyone have a quick example on how to run Websocket in background?

Thanks in advance

@jcislinsky
Copy link

+1

@texasexile
Copy link

You won't be able to keep sockets open in the background. I use sockets to deliver messages from a server. When the app comes back to foreground, I ask the server to catch up on messages sent since the last message.

You can also use push notifications if you need to deliver messages when the app is in the background.

@acmacalister
Copy link
Collaborator

@texasexile is correct. See issue #309 for more information on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants