首页 > 解决方案 > 后台应用刷新

问题描述

我正在尝试在 iOS App 中实现后台刷新。我需要根据位置调用一个类调用“updatedropinanddropout”。我在应用程序处于前台时添加了计时器类,它工作正常,当应用程序进入后台时它不工作。我的意思是我不能打电话给班级。

Timer.scheduledTimer(timeInterval: 4, target: self, selector: #selector(runCode), userInfo: nil, repeats: true)

我浏览了苹果文档func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval) 我不知道如何使用这个功能

标签: iosswift

解决方案


推荐阅读