Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Can it support background mode? #61

Closed
NikitaCh opened this issue Aug 29, 2016 · 5 comments
Closed

Can it support background mode? #61

NikitaCh opened this issue Aug 29, 2016 · 5 comments

Comments

@NikitaCh
Copy link

Hi, can this library keep connection alive when user put an application on background?

Thanks,
Nikita

@tidwall
Copy link
Owner

tidwall commented Aug 29, 2016

Yes. As long as your application has permission to use the network in the background, such as a VoIP app.

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html.

@NikitaCh
Copy link
Author

I've enabled all background modes.
Also i've set service of WebSocket instance to .Background.
But as soon as i get to background mode, after about 30 seconds websocket closes the connection.

Thanks,
Nikita.

@tidwall
Copy link
Owner

tidwall commented Aug 29, 2016

It's sounds like iOS is still killing the connection when your app goes to the background. SwiftWebSocket does supports long running connections, so there must be a setting that is being missed. You may want to ask on https://forums.developer.apple.com

@NikitaCh
Copy link
Author

Thanks,

I've found post by link: https://forums.developer.apple.com/thread/35065?q=Websocket
Seems like iOS will kill it anyway, it can just give some seconds to finish your networking...

Hope someone there knows how to workaround it somehow.

As this is not your lib problem, i'm closing the issue. Thank you for quick responses.

Thanks,
Nikita.

@tidwall
Copy link
Owner

tidwall commented Aug 30, 2016

You're welcome and good luck.

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

No branches or pull requests

2 participants