19 lines
444 B
TypeScript
19 lines
444 B
TypeScript
import BackgroundFetch, {
|
|
BackgroundFetchStatus,
|
|
} from 'react-native-background-fetch'
|
|
|
|
export function configure(
|
|
handler: (taskId: string) => Promise<void>,
|
|
timeoutHandler: (taskId: string) => Promise<void>,
|
|
): Promise<BackgroundFetchStatus> {
|
|
return BackgroundFetch.configure(
|
|
{minimumFetchInterval: 15},
|
|
handler,
|
|
timeoutHandler,
|
|
)
|
|
}
|
|
|
|
export function finish(taskId: string) {
|
|
return BackgroundFetch.finish(taskId)
|
|
}
|