Is it possible to run persistent tcp listening socket on iOS, even when my App is not the foreground app?

时间:2019-01-30 16:35:41

标签: ios

The iOS APIs allow me to open listening sockets for example using the ServerSocket class, however if my App is not in the foreground I assume I won't receive any requests sent to the socket. Is there a way I can keep the listening socket open in the background? Thanks!

1 个答案:

答案 0 :(得分:0)

经过进一步的研究,我现在相信在大多数情况下,iOS上的监听套接字仅在您的应用程序为前台时才有用。

我发现的唯一允许后台持久监听套接字的方法会滥用API的其他部分,例如位置API,因此不适合对此功能进行学术演示。