Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackgroundFetch not running #3582

Closed
leighquince opened this issue Feb 26, 2019 · 97 comments
Closed

BackgroundFetch not running #3582

leighquince opened this issue Feb 26, 2019 · 97 comments
Assignees

Comments

@leighquince
Copy link

leighquince commented Feb 26, 2019

Environment

Expo CLI 2.11.1 environment info:
    System:
      OS: macOS 10.14.3
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.6.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.8.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 2.11.1

app's target - iOS, Standalone

Steps to Reproduce

  1. Allow background fetch in app.json
"ios": {
    "infoPlist": {
        "UIBackgroundModes": [
		"location",
		"fetch"
	]
  1. define a task in App.js
defineHealthTask = () => {
   	TaskManager.defineTask(taskName, async () => {
   		try {
   			await UserRemoteLogService.logWithTaskType("STEPS_TASK_RUNNING");
   			return BackgroundFetch.Result.NewData;
   		} catch (error) {
   		        return BackgroundFetch.Result.Failed;
   		}
   	});
   };
  1. register task at some point of the apps running
await UserRemoteLogService.logWithTaskType("STEPS_TASK_REGISTRATION_REQUESTED");
	const pedometerAvailable = await Pedometer.isAvailableAsync();
	const backGroundFetchStatus = await BackgroundFetch.getStatusAsync();
	if (pedometerAvailable && BackgroundFetch.Status.Available === backGroundFetchStatus) {
		await BackgroundFetch.registerTaskAsync(taskName, {
			userBusinessId: user.businessId
		});
		UserRemoteLogService.logWithTaskType("STEPS_TASK_REGISTERED");
	}
  1. set minimum interval for task in seconds
    BackgroundFetch.setMinimumIntervalAsync(60);

Expected Behavior

App should periodically call my server to log that the background task is running

Actual Behavior

Never see the background task run, although i do see the logs that show the background task was registered. The logging service i use has been used to show when location background task has run so this logging service should log if the task runs

My main question is has anyone seen background fetch run? if so have i just configured it wrong?

@sjchmiela
Copy link
Contributor

Hey, @leighquince! As noted in the documentation, TaskManager.defineTask has to be called in global scope of the app, not in a component's function (like defineHealthTask). Try moving call to defineTask to the global level of the app (like in the example in the documentation) and see if it helps.

@leighquince
Copy link
Author

leighquince commented Feb 26, 2019

In my App.js I call defineHealthTask (it's not in a react component). Calling it directly in App.js or via a function that would be evaluated at the same time should have no difference? I'll give it a go though, thanks

@tcdavis
Copy link
Contributor

tcdavis commented Feb 26, 2019

Would help if you could give us a snack or toy repo demonstrating the issue if changing the call context doesn't resolve it

@leighquince
Copy link
Author

leighquince commented Feb 27, 2019

A quick snack https://snack.expo.io/@domosafety/background-fetch.

Task is defined at top level, registered when App mounts, no logs are seen to show that the background task runs.

Also defining the task directly rather than through a call had no effect in my actual App.
Cheers

@Oakyden
Copy link

Oakyden commented Mar 4, 2019

Struggling with this too, i have defined a task in Global scope (GET_STEPS), but console logging the promise returns "undefined".

BackgroundFetch.registerTaskAsync(GET_STEPS) .then( (data) => {console.log("task data is ", data)} )

I put BackgroundFetch.registerTaskAsync in my app.js render method for now, but it appears to not work.

@superyarik
Copy link
Contributor

@Oakyden there is no data income in BackgroundFetch. you can call fetch, process it and return BackgroundFetch.Result.### result.

@superyarik
Copy link
Contributor

i can confirm that BackgroundFetch work for me, but very strange. looks like i can not call anything like in main app(asyncstorage, get coordinates or something like this) and frequency of calling very various, it's making debug hard. So i decide to wait android implementation.

@Oakyden
Copy link

Oakyden commented Mar 5, 2019

Can you share an example expo snack or similar @superyarik ? especially if you use a simple API example like https://jsonplaceholder.typicode.com/

@mskg
Copy link

mskg commented Mar 20, 2019

It took me a long while to understand what was my problem. The expo documentation is a bit misleading. According to Apple you MUST call BackgroundFetch.setMinimumIntervalAsync in order for the job to be scheduled.

So, you have to

  1. Always call TaskManager.defineTask.
  2. Check if task is registered with BackgroundFetch. If not, register.
  3. Always call BackgroundFetch.setMinimumIntervalAsync.

Be aware that an emulator does not run your task, that happens only on real devices.

The following worked for me:

export async function registerFetchTask() {
    TaskManager.defineTask(FETCH_TASKNAME, runBackgroundSaga);

    const status = await BackgroundFetch.getStatusAsync();
    switch (status) {
        case BackgroundFetch.Status.Restricted:
        case BackgroundFetch.Status.Denied:
            logger.log("Background execution is disabled");
            return;

        default: {
            logger.debug("Background execution allowed");

            let tasks = await TaskManager.getRegisteredTasksAsync();
            if (tasks.find(f => f.taskName === FETCH_TASKNAME) == null) {
                logger.log("Registering task");
                await BackgroundFetch.registerTaskAsync(FETCH_TASKNAME);

                tasks = await TaskManager.getRegisteredTasksAsync();
                logger.debug("Registered tasks", tasks);
            } else {
                logger.log(`Task ${FETCH_TASKNAME} already registered, skipping`);
            }

            logger.log("Setting interval to", INTERVAL);
            await BackgroundFetch.setMinimumIntervalAsync(INTERVAL);
        }
    }
}

@choco9620
Copy link

Hello, I have the same problem, the global task was defined but it is not executed in the interval, is it possible that someone can share functional code ?, since the expo documentation does not define anything.

@tomas1000r
Copy link

Hello, it looks like we need to use Location.startLocationUpdatesAsync('taskName') in order to get background tasks working. It also requires that we ask for the location permission and it should be set to "Allow always". It looks like that BackgroundFetch is tightly coupled with location. Don't know why.

@BrodaNoel
Copy link
Contributor

BrodaNoel commented Mar 28, 2019

@mskg you should call BackgroundFetch.setMinimumIntervalAsync(INTERVAL); only if you are registering the task, right? Check that in your code you are actually calling it always.

On other hand, remember that there is a function already created for doing that check: TaskManager.isTaskRegisteredAsync(TASK_NAME)

@mskg
Copy link

mskg commented Mar 28, 2019

@BrodaNoel no, you MUST call it every time when the App starts. See https://developer.apple.com/documentation/uikit/uiapplication/1623100-setminimumbackgroundfetchinterva

The isTaskRegisteredAsync would definitly be a shortcut for the code I posted. Still, it doesn't change the behavior.

@SowinskiMateusz
Copy link

Hello, it looks like we need to use Location.startLocationUpdatesAsync('taskName') in order to get background tasks working. It also requires that we ask for the location permission and it should be set to "Allow always". It looks like that BackgroundFetch is tightly coupled with location. Don't know why.

Is it really true? This is the only command that fires the task? Does not it make sense? Is there any other command not related to Location?

@mskg
Copy link

mskg commented Apr 3, 2019

@SowinskiMateusz no, see my example above.

@Bug-Reaper
Copy link

@mskg

Could you provide a more complete example, or possibly add comments to your original

@farzd
Copy link

farzd commented Apr 8, 2019

Doesnt appear to work for me either, my setup for geofencing works so following same convention, define task in global scope etc

  TaskManager.defineTask(client.tasks.background, () => {
    try {
      console.log('doesnt log')
      return BackgroundFetch.Result.NewData
    } catch (error) {
      return BackgroundFetch.Result.Failed
    }
  })

Manual trigger inside a component

    let isRegistered = await TaskManager.isTaskRegisteredAsync(
      client.tasks.background
    )
    if (isRegistered) {
      console.log('unregister task ...')
      await BackgroundFetch.unregisterTaskAsync(client.tasks.background)
    }

    const status = await BackgroundFetch.getStatusAsync()
    console.log(BackgroundFetch.Status[status]) //Available 
    await BackgroundFetch.setMinimumIntervalAsync(100)
    await BackgroundFetch.registerTaskAsync(client.tasks.background)

adding this at the end appears to make it work, as suggested by @tomas1000r why? @tsapeta

    Location.startLocationUpdatesAsync(client.tasks.background)

@farzd
Copy link

farzd commented Apr 8, 2019

The example provided here: https://github.com/expo/expo/blob/master/apps/native-component-list/screens/BackgroundFetchScreen.js

I've tailored it to work without the alpha release and without react navigation,
it registers the task and task status is available but no logs for fetch [tested on iPhone7, ios12, via expo client]

code: https://pastebin.com/gNU5QnJv

@tsapeta
Copy link
Member

tsapeta commented Apr 8, 2019

So, you have to

  1. Always call TaskManager.defineTask.
  2. Check if task is registered with BackgroundFetch. If not, register.
  3. Always call BackgroundFetch.setMinimumIntervalAsync.

re: 2. - there is no need to check if background fetch task is already registered - if you try to register it again, then it just overwrites the previously registered task, which is fine 👌 Except that, these steps look good.

adding this at the end appears to make it work, as suggested by @tomas1000r why? @tsapeta

    Location.startLocationUpdatesAsync(client.tasks.background)

I'll try to check it out soon, but it seems weird to me as there is no connection between location and background fetch. They are completely independent features. My assumption is that, if you turn on background location then your app is actually always active, so the background fetch can occur in the time you set by setMinimumIntervalAsync. However, if the app is not active, then it strongly depends on the operating system and how you use the application. Apple has its own algorithm which defines how often the background fetch should trigger, based on your own usage of the app. If you use it a lot, then it will fetch as often as possible, but if you use it like at 4pm every day, the background fetch should trigger just before, so your data is updated when you launch it. So imho you shouldn't worry about the task not being done on time - Apple knows better when to call it 😅

@farzd
Copy link

farzd commented Apr 8, 2019

@tsapeta can you please explain why this doesnt work: https://pastebin.com/gNU5QnJv
its taken from your master branch and altered slightly so updates are shown when app is brought to foreground, the fetch call is never made.

@tsapeta
Copy link
Member

tsapeta commented Apr 8, 2019

@farzd
In this pastebin, you're passing a second argument with task options to BackgroundFetch.registerTaskAsync that is not yet available in Expo Client. It will be once we release SDK33. In SDK32 the minimum interval must be set by BackgroundFetch.setMinimumIntervalAsync - and it must be called because iOS defaults to a really big number.
Also, keep in mind that BackgroundFetch is not supported on Android in SDK32.

@farzd
Copy link

farzd commented Apr 8, 2019

thanks for your time @tsapeta, i realised the arguments were for SDK33 but assumed it would no op anyway.
I've tried the code with explicitly setting BackgroundFetch.setMinimumIntervalAsync however it has made no difference, this is the issue a lot of people on this thread are facing.

Background app refresh is on in settings etc, not sure what else to check

@mskg
Copy link

mskg commented Apr 10, 2019

At least according to my experience here: On iOS it is actually really like @tsapeta described. The time you set is just an indication on how often data might change. If it doesn’t (depending on the result), you‘re scheduled less frequent. Also, if you don’t use the App, the fetch will most likely not run.

In my case, the fetch currently runs directly after/when I open the App in the morning. I seem to do that regularly :)

@baptistemanson
Copy link

I directly tested the snack on a ios device and on a simulator using the expo app, and I cannot get

console.log('background fetch running') ;

to display, with or without remote debugging on, even after waiting 10min for it to occur. How can I debug further?

@g-bastianelli
Copy link

I m unable to make it works on ios with SDK33. Can have a working snack or example?

@mslavik2
Copy link

I am having trouble with SDK33 on ios as well. A working snack would be very helpful in debugging the issue and solidify the steps required to make the background fetch work.

@Kency1013
Copy link

BackgroundFetch not working with me. I use expo client test it. Is it only working in standalone app?

@bobymicroby
Copy link

@mczernek 👍 Upvote for more reliable background tasks via BGTaskScheduler

@ugurdnlr
Copy link

ugurdnlr commented Jun 5, 2020

I have the same problem. Have there been any developments?

@harveyjo
Copy link

harveyjo commented Jun 8, 2020

+1 on needed this to be more reliable. Having the same issues many have described above after checking many sources of documentation and many forums. Have been developing an app for months that is basically done besides needing this feature to work, ASAP.

@mczernek
Copy link
Contributor

mczernek commented Jun 9, 2020

This is really frustrating after I tried all the code above and checked expo docs for over 10 times at least still couldn't make it work on my device nor the simulator.

If expo team could provide a snack or an example of TaskManager or BackgroundFetch, it will save a ton of time for me.

There is example for virtually every module we provide available within our repository. Here's one for BackgroundFetch.
There might seem obsolete sometimes (no hooks and so on) but we test it regularly so they should, most of the time, show each module works and should be used.

+1 on needed this to be more reliable. Having the same issues many have described above after checking many sources of documentation and many forums. Have been developing an app for months that is basically done besides needing this feature to work, ASAP.

We are having it on our map. Exact timeline is difficult to predict, I am afraid. It won't, however, fix most pressing issue for you, which is executing tasks even after app is being swiped from recents. This is, and probably will be, system limitation.

As of now, sine BackgroundFetch seems to be working with system limitations, let me close this issue for now. For maintaining order, please report feature request if you wish to extend background capabilities for expo.

@mczernek mczernek closed this as completed Jun 9, 2020
@juancardlm
Copy link

To make background tasks work, I used the foregroundService option for the startLocationUpdatesAsync method as it says in the docs:

Use this option to put the location service into a foreground state, which will make location updates in the background as frequent as in the foreground state. As a downside, it requires a sticky notification, so the user will be aware that your app is running and consumes more resources even if backgrounded. (Available since Android 8.0)

This is how it looks like on my code:

Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, { 
    accuracy: Location.Accuracy.BestForNavigation,
    timeInterval: LOCATION_TIME_INTERVAL,
    distanceInterval: LOCATION_DISTANCE_INTERVAL,
    foregroundService: {
        notificationTitle: LOCATION_TITLE,
        notificationBody: LOCATION_SUBTITLE
    }
});

BackgroundFetch.registerTaskAsync(LOCATION_TASK_NAME, {
        minimumInterval: FETCH_INTERVAL,
        stopOnTerminate: false,
        startOnBoot: true
},).then(() => BackgroundFetch.setMinimumIntervalAsync(FETCH_INTERVAL));

I hope it helps!

@aparson
Copy link

aparson commented Aug 21, 2020

To make background tasks work, I used the foregroundService option for the startLocationUpdatesAsync method as it says in the docs:

Use this option to put the location service into a foreground state, which will make location updates in the background as frequent as in the foreground state. As a downside, it requires a sticky notification, so the user will be aware that your app is running and consumes more resources even if backgrounded. (Available since Android 8.0)

This is how it looks like on my code:

Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, { 
    accuracy: Location.Accuracy.BestForNavigation,
    timeInterval: LOCATION_TIME_INTERVAL,
    distanceInterval: LOCATION_DISTANCE_INTERVAL,
    foregroundService: {
        notificationTitle: LOCATION_TITLE,
        notificationBody: LOCATION_SUBTITLE
    }
});

BackgroundFetch.registerTaskAsync(LOCATION_TASK_NAME, {
        minimumInterval: FETCH_INTERVAL,
        stopOnTerminate: false,
        startOnBoot: true
},).then(() => BackgroundFetch.setMinimumIntervalAsync(FETCH_INTERVAL));

I hope it helps!

How are you retrieving the data from the location updates? In the docs it said to use TaskManager and define a task but that is not working for me.

@juancardlm
Copy link

How are you retrieving the data from the location updates? In the docs it said to use TaskManager and define a task but that is not working for me.

This is how I define the task, just before the methods above.
Remember it cannot be called in any of React lifecycle methods like componentDidMount

TaskManager.defineTask(LOCATION_TASK_NAME, ({ data, error }) => {
     if (error)
        console.log("Error getting user location: ${JSON.stringify(error)}");
    else {
        const coords = data.locations[0].coords;
        console.log("User location retrieved: [${coords.latitude}, ${coords.longitude}]");
    }
});

If you have any problems getting current location, you can also use this code in the task function

navigator.geolocation.getCurrentPosition(
    (position) => {
        console.log(`Position retrieved: [${JSON.stringify(position)}]`);                               
    }, 
    (error) => console.log(`Unable to get position ${JSON.stringify(error)}`)
);

@obo20
Copy link

obo20 commented Nov 4, 2020

So, you have to

  1. Always call TaskManager.defineTask.
  2. Check if task is registered with BackgroundFetch. If not, register.
  3. Always call BackgroundFetch.setMinimumIntervalAsync.

re: 2. - there is no need to check if background fetch task is already registered - if you try to register it again, then it just overwrites the previously registered task, which is fine 👌 Except that, these steps look good.

adding this at the end appears to make it work, as suggested by @tomas1000r why? @tsapeta

    Location.startLocationUpdatesAsync(client.tasks.background)

I'll try to check it out soon, but it seems weird to me as there is no connection between location and background fetch. They are completely independent features. My assumption is that, if you turn on background location then your app is actually always active, so the background fetch can occur in the time you set by setMinimumIntervalAsync. However, if the app is not active, then it strongly depends on the operating system and how you use the application. Apple has its own algorithm which defines how often the background fetch should trigger, based on your own usage of the app. If you use it a lot, then it will fetch as often as possible, but if you use it like at 4pm every day, the background fetch should trigger just before, so your data is updated when you launch it. So imho you shouldn't worry about the task not being done on time - Apple knows better when to call it 😅

@tsapeta Can you think of anything that can be done from within Expo that can replicate this 'keep active' functionality without requiring location updates constantly being run in the background?

Unfortunately with iOS now actively showing at all times when an app is using locational data, having our app constantly checking the location of our users when it has no need to is a really bad look for our application.

@srikanthkh
Copy link

I can not get background fetch to work on iOS(when app is in background or not does not matter). I tried using the code from the comments but nothing seem to work. I was able to get the android version working with the same code though. Tried using expo 39 and 40 with all latest packages.

  1. TaskManager.defineTask.
  2. Check if task is registered with BackgroundFetch. If not, register.
  3. call BackgroundFetch.setMinimumIntervalAsync.
    Adding Location.startLocationUpdatesAsync(BACKGROUND_TASK) does seem to invoke the background task once.

Was anyone successful in getting background fetch to work without Location in iOS?? Please share code. Thanks for your help in advance.

@juancardlm
Copy link

I can not get background fetch to work on iOS(when app is in background or not does not matter). I tried using the code from the comments but nothing seem to work. I was able to get the android version working with the same code though. Tried using expo 39 and 40 with all latest packages.

  1. TaskManager.defineTask.
  2. Check if task is registered with BackgroundFetch. If not, register.
  3. call BackgroundFetch.setMinimumIntervalAsync.
    Adding Location.startLocationUpdatesAsync(BACKGROUND_TASK) does seem to invoke the background task once.

Was anyone successful in getting background fetch to work without Location in iOS?? Please share code. Thanks for your help in advance.

Have you tried foregroundService option for Location.startLocationUpdatesAsync method?
This is how it looks like on my code (works both Android and IOS):

Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, {
    accuracy: Location.Accuracy.BestForNavigation,
    timeInterval: LOCATION_TIME_INTERVAL,
    distanceInterval: LOCATION_DISTANCE_INTERVAL,
    foregroundService: {
        notificationTitle: LOCATION_TITLE,
        notificationBody: LOCATION_SUBTITLE
    }
});

@srikanthkh
Copy link

@juancardlm This does work.. thank you for your reply! But I am trying to get background fetch work without using expo Location. My app does not need Location so do not want to ask permission for that from the user.

@artsnr1
Copy link

artsnr1 commented Jan 26, 2021

This is really frustrating after I tried all the code above and checked expo docs for over 10 times at least still couldn't make it work on my device nor the simulator.
If expo team could provide a snack or an example of TaskManager or BackgroundFetch, it will save a ton of time for me.

There is example for virtually every module we provide available within our repository. Here's one for BackgroundFetch.
There might seem obsolete sometimes (no hooks and so on) but we test it regularly so they should, most of the time, show each module works and should be used.

+1 on needed this to be more reliable. Having the same issues many have described above after checking many sources of documentation and many forums. Have been developing an app for months that is basically done besides needing this feature to work, ASAP.

We are having it on our map. Exact timeline is difficult to predict, I am afraid. It won't, however, fix most pressing issue for you, which is executing tasks even after app is being swiped from recents. This is, and probably will be, system limitation.

As of now, sine BackgroundFetch seems to be working with system limitations, let me close this issue for now. For maintaining order, please report feature request if you wish to extend background capabilities for expo.

When would this be resolved. It is such a 'must-have' feature. I need to fetch data periodically and most of the time an app is not in the background/foreground

@srikanthkh
Copy link

@artsnr1 Does background fetch work for you when the app is in background/foreground? If Yes, do you use location?

@artsnr1
Copy link

artsnr1 commented Jan 26, 2021

@srikanthkh I haven't tried it yet as it doesn't provide for my need to work even on app termination

@bsor-dev
Copy link

If your app requires background location, the best solution is to eject so you can use native modules. @mauron85/react-native-background-geolocation or headless JS

@artsnr1
Copy link

artsnr1 commented Jan 26, 2021

Unfortunately, ejection is the last resort

@pxmage
Copy link

pxmage commented Jan 26, 2021

This is really frustrating after I tried all the code above and checked expo docs for over 10 times at least still couldn't make it work on my device nor the simulator.

If expo team could provide a snack or an example of TaskManager or BackgroundFetch, it will save a ton of time for me.

Well, finally I ejected, any recommendations for the alternatives?

@bsor-dev
Copy link

To me, I used mauron combined with headlessJS. Because mauron location listener doesn't work if app is terminated. That's why I used headlessJS. But sending of location using postTemplate will work even if app is terminated. I used headlessJS just for my own purpose.

@trajano
Copy link
Contributor

trajano commented Feb 5, 2021

I have an MVCE that shows this problem https://github.com/trajano/expo-mvce it's based off https://github.com/expo/expo/blob/master/apps/native-component-list/src/screens/BackgroundFetchScreen.tsx in my case it works on Android, but not iOS Expo clients. I am using a custom Expo client as well

I also added BackgroundFetch.setMinimumIntervalAsync(60);

@sicero
Copy link

sicero commented Feb 17, 2021

Why was this issue closed if no resolution - it seems such a fundamental feature of BackGround fetch? What is the alternative?

@LeifS
Copy link

LeifS commented Mar 3, 2021

Was a solution ever found for this problem?
Or is the only way to get BackgroundFetch to work on iOS to use the hacky Location.startLocationUpdatesAsync() work around? The problem with this fix is that it runs the task in the foreground as well as the background, which causes new issues.

@trajano
Copy link
Contributor

trajano commented Mar 4, 2021

@LeifS @sicero it does work, my MVCE just needs to update the README but the MVCE does work. There's one caveat, on iOS you can't really predict when the background fetch will fire. You need to keep the phone fully charged and plugged into get it more frequent https://github.com/trajano/expo-mvce. I lost track of this issue number so I wasn't able to update it till I saw the alert.

@marksalpeter
Copy link

marksalpeter commented May 8, 2021

BackgroundFetch doesn’t work at all for me on the simulator, in expo go, or in the compiled app. The task is defined in the list of tasks, it’s properly started, and the background fetch never fires - not one time. It fails completely silently with no explanation as to why.

I’ve abandoned expo as a framework because of the lack of support for this feature and because of how poorly they’ve handled this matter. I strongly recommend that others do the same, before they get burned as well. This framework is extremely unreliable and the support for it is nonexistent.

@rikur
Copy link

rikur commented Jul 13, 2021

@marksalpeter I just did the opposite: I'm ditching semi-abandoned volunteer-run react-native libraries and been enjoying Expo unimodules a lot more. Best of luck!

@brentvatne
Copy link
Member

brentvatne commented Jul 14, 2021

for anyone that stumbles on this - @ajsmth recently wrote up some useful instructions for trigger background fetch manually, which is much easier than waiting for the operating system to kick in for you: https://docs.expo.io/versions/latest/sdk/background-fetch/#triggering-background-fetches

keep in mind the following limitation for iOS as well: BackgroundFetch only works when the app is backgrounded, not if the app was terminated or upon device reboot.

i'm going to lock this thread because as far as we know this is working as expected, please make a new issue if you continue to encounter issues.

@expo expo locked and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests