null is not an object (evaluating 'RNBackgroundTimer.setTimeout') - RN version 0.60.4
See original GitHub issueI am continually getting this error thrown and it stops the background timer from working on Android. It works no issues on iOS however.
I am not using the setTimeout function at all, I am using BackgroundTimer.setInterval if the platform is Android and using BackgroundTimer.runBackgroundTimer for iOS as even though it says it is cross platform, it only seemed to work for iOS.
React Native version: 0.60.4 React: 16.9.0 react-native-background-timer: 2.1.1
I have tried manually linking as the readme suggests, but this did not resolve the issue. Any help would be much appreciated.
passiveMode = () => {
if (this.platform == 'ios') {
BackgroundTimer.runBackgroundTimer(() => {
this.main()
}, 6000);
} else {
this.bgIntFunc = BackgroundTimer.setInterval(() => {
this.main()
}, 6000);
}
this.active = false
}
As soon as the setInterval function gets called, the error is thrown and all the functionality stops for the background timer.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
react-native-background-timer, null is not an object
The equipped function, setInterval of javascript and etc. of course works fine as a timer, but actually they don't work behind in react...
Read more >null is not an object (evaluating 'RNBackgroundTimer.setTimeout ...
null is not an object (evaluating 'RNBackgroundTimer.setTimeout') - RN version 0.60.4 ... I am continually getting this error thrown and it stops the...
Read more >react-native-background-timer - npm
Emit event periodically (even when app is in the background). Latest version: 2.4.1, last published: 2 years ago.
Read more >react-native-background-timer - npm package - Snyk
Learn more about react-native-background-timer: package health score, popularity, security, maintenance, versions and more.
Read more >React Native Background Timer - Morioh
Android: TypeError: Cannot read property 'setTimeout' of undefined or TypeError: null is not an object (evaluating 'RNBackgroundTimer.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try
I’m also facing this problem although I already followed the README (manual linking included) 😦