I am currently developing an app for iOS with expo SDK-version 32, background fetch is working on expo client app?
Steps to Reproduce
- Allow background fetch in app.json
"ios": {
"infoPlist": {
"UIBackgroundModes": [
"location",
"fetch"
]
2.register task
await BackgroundFetch.registerTaskAsync(FETCH_BACKGROUND_TASK);
BackgroundFetch.setMinimumIntervalAsync(60);
- define task
TaskManager.defineTask(FETCH_BACKGROUND_TASK, async () => {
try {
const now = Date.now();
setItemLocalStorage(BACKGROUND_TIME_UPDATE, {
response: now.toString(),
});
return BackgroundFetch.Result.NewData;
} catch (error) {
return BackgroundFetch.Result.Failed;
}
});
Thanks