Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function registerTaskAsync(taskName: string, options: BackgroundFetchOptions = {}): Promise {
if (!ExpoBackgroundFetch.registerTaskAsync) {
throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync')
}
if (!TaskManager.isTaskDefined(taskName)) {
throw new Error(
`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`
);
}
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
}
export async function registerTaskAsync(taskName, options = {}) {
if (!ExpoBackgroundFetch.registerTaskAsync) {
throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync');
}
if (!TaskManager.isTaskDefined(taskName)) {
throw new Error(`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`);
}
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
}
export async function unregisterTaskAsync(taskName) {
export async function registerTaskAsync(taskName: string, options: BackgroundFetchOptions = {}): Promise {
if (!ExpoBackgroundFetch.registerTaskAsync) {
throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync')
}
if (!TaskManager.isTaskDefined(taskName)) {
throw new Error(
`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`
);
}
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
}
export async function registerTaskAsync(taskName, options = {}) {
if (!ExpoBackgroundFetch.registerTaskAsync) {
throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync');
}
if (!TaskManager.isTaskDefined(taskName)) {
throw new Error(`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`);
}
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
}
export async function unregisterTaskAsync(taskName) {