当应用程序进入后台时如何保持Swift Socket IO运行?

时间:2017-09-16 04:07:07

标签: ios swift socket.io

我正在开发一个应用程序,如果应用程序进入后台,需要保持套接字连接。当应用程序处于前台时,套接字连接运行良好,但当它进入后台时它会关闭。我尝试过使用applicationDidEnterBackground(_:),但它仍在关闭连接。我的Info.plist已经设置了必要的背景值。

1 个答案:

答案 0 :(得分:0)

你不能用ios(双重到苹果政策https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html)。

您应该通过为IOS实施远程通知来实现。

相关问题