Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
});