expo: [expo-background-fetch] Background fetch is not running

🐛 Bug Report

Summary of Issue

Hi everyone, I’m writing this issue because expo-background-fetch doesn’t work with my project.

Environment

  Expo CLI 3.24.2 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.7 - ~/.nvm/versions/node/v10.19.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.6 AI-192.7142.36.36.6241897
      Xcode: 11.6/11E708 - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 3.24.2

Reproducible Demo

I’ve created a little project which is here.

It’s a little app which uses some chunks of code that I’ve seen in this issue.

Expected Behavior vs Actual Behavior

My task function doesn’t work whereas I initialized the tasks.

console.log(
      "Task is running in background each ",
      INTERVAL_TASKS,
      " seconds."
    );

I also try to switch between my actuel version of the npm package to the latest (8.4.0). It doesn’t change

"dependencies": {
    "expo": "~38.0.8",
    "expo-background-fetch": "~8.3.0",
    "expo-status-bar": "^1.0.2",
    "expo-task-manager": "~8.3.0",
    "react": "~16.11.0",
    "react-dom": "~16.11.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
    "react-native-web": "~0.11.7"
  },

Any guesses to solve this issue ?

Thanks for your help.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 27 (14 by maintainers)

Most upvoted comments

@ppulwey try to do expo upgrade I just did that and it resolved my issue in #11866

I still have that issue for iOS. Android works perfectly fine, but iOS won’t fire the fetch event when the app is backgrounded. Does anyone have a solution for this situation?

we’re still having problem with it om IOS. our application can works in offline mode and we need to send some data to the backend when the app is in the background and the internet is available. but as I can see IOS doesn’t allow us to send several requests to the backend in background. Is there anyone there who has figured this out?

Push notifications should work (but I didn’t try), but not in China for Android which is why I had to go through alternatives that do not involve Google. Another alternative I tried but failed was https://pushy.me/ but that does not work in Expo https://github.com/pushy-me/pushy-react-native/issues/61

Yes it’s required by the docs.