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

[iOS] Clear timeout

Open cernadasjuan opened this issue 6 years ago • 1 comments

Hi!

There is any way to clear a timeout in iOS? I saw that method is commented in iOS source code (RNBackgroundTimer.m)

/*
RCT_EXPORT_METHOD(clearTimeout:(int)timeoutId
                  resolver:(RCTPromiseResolveBlock)resolve
                  rejecter:(RCTPromiseRejectBlock)reject)
{
    // Do nothing :)
    // timeout will be ignored in javascript anyway :)
}*/

Thanks!!

cernadasjuan avatar Oct 15 '19 17:10 cernadasjuan

On iOS, I used the primary fonction cleartimeout to clear this timeout:

BackgroundTimer.start(); timeroutID = setTimeout(() => { TrackPlayer.pause(); logInfo('BackgroundTimer=END'); }, duration); BackgroundTimer.stop();

yelkamel avatar Jan 14 '20 16:01 yelkamel