当应用在后台时,Web插座会断开连接
我正在使用StarsCream库进行插座连接。 [https://github.com/daltoniam/starscream] [1]
它的工作正常,但是一旦应用程序在后台处于后台,它立即断开连接,我也尝试设置后台过程许可,但它不起作用。
同样,当我断开连接时,它将继续从服务器接收消息。
if socket != nil{
socket.delegate = nil
socket.disconnect()
socket = nil
}
如何处理用户正在与代理商聊天的情况,并且它将转向后台,当他回来时,可以从他留下的地方恢复,包括他在那个时间范围内错过的所有聊天,
任何帮助都将不胜感激,谢谢。
I am using StarScream library for socket connection.
[https://github.com/daltoniam/Starscream][1]
It is working fine as expected but as soon as app goes in background it gets disconnected immediately, i tried setting background process permission as well but it didn't work.
Also when i disconnect it continues to receive the messages from server.
if socket != nil{
socket.delegate = nil
socket.disconnect()
socket = nil
}
How to handle the situation where user is chatting with an agent and it goes to background and when he came back, can resume from where he left including all the chats he missed in that time range
Any help will be appreciated, Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论