当iOS应用程序处于后台时进行周期性的网络调用

时间:2022-12-29 16:58:55

I'm currently working on an app that should periodically (every minute) perform a network call while the app is backgrounded or killed. This network call will send information to our API.

我目前正在开发一个应用程序,该应用程序应该在后台运行或终止时定期(每分钟)执行网络调用。这个网络调用将向我们的API发送信息。

Is this possible on iOS? How?

iOS上有可能吗?如何?

1 个解决方案

#1


2  

Assuming you want a service like a Social Media app, where it will check in the background every minute for new activity, you should use background execution.

假设你想要一个像社交媒体应用这样的服务,它每分钟都会在后台检查新活动,你应该使用后台执行。

Have a look at this Background Execution tutorial and the Apple Reference for Background Execution.

请看本背景执行教程和苹果背景执行参考。

#1


2  

Assuming you want a service like a Social Media app, where it will check in the background every minute for new activity, you should use background execution.

假设你想要一个像社交媒体应用这样的服务,它每分钟都会在后台检查新活动,你应该使用后台执行。

Have a look at this Background Execution tutorial and the Apple Reference for Background Execution.

请看本背景执行教程和苹果背景执行参考。