How to use the expo-background-fetch.Result function in expo-background-fetch

To help you get started, we’ve selected a few expo-background-fetch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / apps / native-component-list / src / screens / BackgroundFetchScreen.tsx View on Github external
TaskManager.defineTask(BACKGROUND_FETCH_TASK, async () => {
  const now = Date.now();

  console.log(`Got background fetch call at date: ${new Date(now).toISOString()}`);
  await AsyncStorage.setItem(LAST_FETCH_DATE_KEY, now.toString());

  return BackgroundFetch.Result.NewData;
});

expo-background-fetch

Expo universal module for BackgroundFetch API

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis