react-native-background-timer icon indicating copy to clipboard operation
react-native-background-timer copied to clipboard

BackgroundTimer.stopBackgroundTimer(); not working globally

Open wdayanand opened this issue 8 years ago • 3 comments

I started timer with BackgroundTimer.runBackgroundTimer and close the app, timer working fine in background but when I restart application and app came to foreground I want to stop that timer so I tried with BackgroundTimer.runBackgroundTimer but its not working

Please let me know how can I stop that timer or let me know how I will know the timer is already running in background

I used "react-native-background-timer": "2.1.0-alpha.6",

wdayanand avatar Oct 09 '18 11:10 wdayanand

Just fix in the source code index.js

In function stopBackgroundTimer() replace: clearTimeout(this.backgroundTimer); to this.clearTimeout(this.backgroundTimer);

it worked for me. Tested in iOS. Not in Android. Author please correct the code.

Prussich avatar Nov 01 '18 16:11 Prussich

Having the same problem, and @Prussich is right

Solitaryo avatar Nov 18 '18 00:11 Solitaryo

@wdayanand @Prussich @Solitaryo fixed in [email protected]

ocetnik avatar Nov 18 '18 19:11 ocetnik