ios - 后台应用刷新
问题描述
我正在尝试在 iOS App 中实现后台刷新。我需要根据位置调用一个类调用“updatedropinanddropout”。我在应用程序处于前台时添加了计时器类,它工作正常,当应用程序进入后台时它不工作。我的意思是我不能打电话给班级。
Timer.scheduledTimer(timeInterval: 4, target: self, selector: #selector(runCode), userInfo: nil, repeats: true)
我浏览了苹果文档func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval)
我不知道如何使用这个功能
解决方案
推荐阅读
- javascript - 正则表达式在任何非字母之前获取字符串
- reactjs - 将字符串变量 prop 传递给 useQuery 函数
- c# - 如何跳到csv文件csvhelper c#的最后一个表/数据集
- python - 如何提高我的模型的准确性?(猫对狗图像识别)
- javascript - 我如何使用反应热键库捕获命令(Windows 上的 ctrl)+ 数字键盘加/减?
- visual-studio-code - 无法在 MacOS 上的 Visual Studio Code 上导入“pyspark”pylint(导入错误)
- google-chrome-extension - 从扩展中获取鼠标悬停时元素的css id
- android - 玩游戏服务成就不起作用
- python - 如何调用包含不同类中的函数的函数?
- flutter - Text() 出错 - 必须向 Text 小部件提供非空字符串