Expo React Native: How to play notification sound for 30 seconds on Android?


I am working on a React Native app using Expo (managed workflow), and I need to implement an emergency alert feature.

The requirement is:
When a push notification is received, a sound should play for around 30 seconds, even if the app is in the background or killed.

Currently, I am using expo-notifications and a custom notification sound. However, I noticed that:

  • The sound only plays for a few seconds (around 3–5 seconds)

  • It does not continue for the full duration of the audio file

  • Behavior varies across Android devices

What I want to know:

  1. Is it possible to play a notification sound for ~30 seconds on Android using Expo (managed workflow)?

  2. If not, what are the limitations imposed by Android or Expo?

  3. Are there any workarounds to achieve a longer or continuous alert sound (for emergency use cases)?

Additional context:

  • App is built with Expo (managed, not ejected)

  • Target platform: Android (primary), iOS optional

  • Use case is similar to an emergency alert or alarm

Any guidance or recommended approach would be appreciated.

1
Mar 31 at 6:18 AM
User AvatarSatheesh Kumar
#android#react-native#push-notification#expo#android-notifications

Accepted Answer

I don't think expo-notifications is able to sufficiently cover your use case because IIRC it uses the NotificationCompat API, which has the following limitation:

> Note: Beginning with Android 8.1 (API level 27), apps can't make a notification sound more than once per second. If your app posts multiple notifications in one second, they all appear as expected, but only the first notification per second makes a sound.

I'd rather look into using AlarmManager API for this. There is an expo package for it but I can't attest to it's quality. You might end up needing to write your own native bindings

User AvatarChris Witalewski
Mar 31 at 11:41 AM
0