ios: stop using react-native-background-timer
Ever since https://github.com/facebook/react-native/pull/23674 landed it has been possible to run timers in the background, assuming your app is allowed to run in the background already, as is our case. So, stop using the library on iOS, which will avoid creatring needless backgound tasks.
This commit is contained in:
parent
ab21e3cd5e
commit
56da400f19
|
@ -415,10 +415,12 @@ function _visitNode(node, callback) {
|
|||
// Required by:
|
||||
// - lib-jitsi-meet
|
||||
// - Strophe
|
||||
global.clearTimeout = BackgroundTimer.clearTimeout.bind(BackgroundTimer);
|
||||
global.clearInterval = BackgroundTimer.clearInterval.bind(BackgroundTimer);
|
||||
global.setInterval = BackgroundTimer.setInterval.bind(BackgroundTimer);
|
||||
global.setTimeout = (fn, ms = 0) => BackgroundTimer.setTimeout(fn, ms);
|
||||
if (Platform.OS === 'android') {
|
||||
global.clearTimeout = BackgroundTimer.clearTimeout.bind(BackgroundTimer);
|
||||
global.clearInterval = BackgroundTimer.clearInterval.bind(BackgroundTimer);
|
||||
global.setInterval = BackgroundTimer.setInterval.bind(BackgroundTimer);
|
||||
global.setTimeout = (fn, ms = 0) => BackgroundTimer.setTimeout(fn, ms);
|
||||
}
|
||||
|
||||
// localStorage
|
||||
if (typeof global.localStorage === 'undefined') {
|
||||
|
|
Loading…
Reference in New Issue