Comments (5)
You can work around this by setting the global methods in a slightly different way, e.g.:
setTimeout = (fn, ms = 0) => Timer.setTimeout(fn, ms)
setInterval = (fn, ms = 0) => Timer.setInterval(fn, ms)
clearTimeout = (fn, ms = 0) => Timer.clearTimeout(fn, ms)
clearInterval = (fn, ms = 0) => Timer.clearInterval(fn, ms)
from react-native-background-timer.
I am getting almost the same error when I enable hot reloading and make a change.
After further testing, I can recreate this issue by setting a timeout with no second parameter. Any suggestions how to resolve this issue?
from react-native-background-timer.
This error occurs every time I enable remote debugging, both iOS and Android.
"react-native": "^0.50.3"
"react-native-background-timer": "^1.3.0"
The following error occurs in iOS:
from react-native-background-timer.
@levity i set the global methods like your example but still get the error , do you have any idea ? 😓
from react-native-background-timer.
Got it solved by checking ms value
setTimeout = (fn, ms = 0) => {
const numberMs = Number(ms)
if (isNaN(numberMs)) return BackgroundTimer.setTimeout(fn, 0)
return BackgroundTimer.setTimeout(fn, numberMs)
}
setInterval = (fn, ms = 0) => {
const numberMs = Number(ms)
if (isNaN(numberMs)) return BackgroundTimer.setInterval(fn, 0)
return BackgroundTimer.setInterval(fn, numberMs)
}
clearTimeout = (fn, ms = 0) => {
const numberMs = Number(ms)
if (isNaN(numberMs)) return BackgroundTimer.clearTimeout(fn, 0)
return BackgroundTimer.clearTimeout(fn, numberMs)
}
clearInterval = (fn, ms = 0) => {
const numberMs = Number(ms)
if (isNaN(numberMs)) return BackgroundTimer.clearInterval(fn, 0)
return BackgroundTimer.clearInterval(fn, numberMs)
}
from react-native-background-timer.
Related Issues (20)
- Can I read and write files?
- The timer works perfectly fine in iOS simulator but not on hardware device HOT 3
- BackgroundTimer stops when app goes to background after Few Sec in IOS React Native IOS HOT 18
- runBackgroundTimer doesn't work on RN 66.3 - Tested on Android HOT 5
- Background service is not working if Background data usage disabled. HOT 1
- Using react-native-background-timer with react-native-web HOT 1
- Terminating app due to uncaught exception NSInternalInconsistencyException HOT 1
- how to get clipboard content on background service
- Testing background timer with useFakeTimers in Jest HOT 4
- Background Action and Graphql HOT 2
- the task is dying out HOT 8
- background task dosen't work when device is in sleep mode. HOT 7
- Is this repo still alive? HOT 5
- BackgroundTimer.clearTimeout does not stop ongoing background task
- Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes HOT 1
- react-native-background-timer not working in android HOT 1
- after upgrading gradle version to 8.2.2 I'm getting this error: Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. HOT 3
- React Native Background Task Termination on Device Lock in Android OS <= 13 HOT 1
- RangeError in long running timers HOT 1
- Problem build/config with MainApplication.kt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-background-timer.