BackgroundTimer.stopBackgroundTimer(); not working
See original GitHub issueHello everyone. I am using react-native-background-timer. And I wanted to perform a function for once only. But the cross platform function BackgroundTimer.runBackgroundTimer() keeps executing the function after every interval. I tried stopping it from the function but it keeps executing the code. I dont know what I am doing wrong. I dont want to use other functions as they are platform dependent. I wanted to use this function because it is cross platform.
Note: I wanted to run the function for once only. My code;
`componentDidMount(){ BackgroundTimer.runBackgroundTimer(() => { this.deleteAll() }, 18000); }
deleteAll=()=>{ console.log(‘Deleted’) BackgroundTimer.stopBackgroundTimer();
}` Any other cross platform approach for executing the function ‘once’ only will be appreciated. Thanks
Will be waiting for reply.
RN Version: 0.63.2 BG-Timer version: Latest package.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
@aashiriftikhar
Try with this:
same here