Foreground service with Expo - possible? Necessary for my use case?

My app requires a feature similar to Uber when the car is on its way (there’s a permanent notification, and frequent updates on the third party location). I believe that I need a foreground service to do this (see https://developer.android.com/guide/components/services). Assuming that foreground service is indeed the way to do this, I believe that Expo doesn’t support them, and RN does via Headless JS. Is this correct? Anything else worth knowing about the topic? I found surprisingly little online, but perhaps it’s my Google-fu. I’ll be happy to hear if my approach is wrong. The key is that, like Uber, up until a certain point, the notification is permanent even if the user exits the app with the back button.

I guess what I’m asking is:

  • Do I need a foreground service to achieve this? Are there other sane alternatives?
  • Does Expo support this?
  • If not, does detached Expo support this?
2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.