gpt4 book ai didi

javascript - React-Native:应用程序关闭时后台应用程序刷新

转载 作者:行者123 更新时间:2023-11-28 16:07:26 56 4
gpt4 key购买 nike

我需要每 30 或 60 分钟更新一次应用程序的数据库。经过大量搜索,我找到了这个模块:

https://github.com/transistorsoft/react-native-background-fetch

正如其页面中所说:

iOS Background Fetch is basically an API which wakes up your app about every 15 minutes (during the user's prime-time hours) and provides your app exactly 30s of background running-time. This plugin will execute your provided callbackFn whenever a background-fetch event occurs. There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible value of UIApplicationBackgroundFetchIntervalMinimum -- iOS determines the rate automatically based upon device usage and time-of-day (ie: fetch-rate is about ~15min during prime-time hours; less frequently when the user is presumed to be sleeping, at 3am for example).

如果我用 swift 写一些代码会怎样?我在 react native 中使用 sqlite 来存储我的数据。如果我在 swift 中编写一些代码来唤醒并检查新数据,我可以访问我用来在 React Native 中存储数据的同一个数据库吗?

我正在使用 react-native-sqlite-storage 将我的数据存储在 react native 中。

https://github.com/andpor/react-native-sqlite-storage

最佳答案

如果你在同一个应用程序下运行后台任务,你可以访问你用来存储在 react native 中的数据库

关于javascript - React-Native:应用程序关闭时后台应用程序刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40068893/

56 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com