1

I am developing my expo app which uses expo notifications. For now, I am working on the notifications for the android version. I set up the Firebase Cloud Messaging credentials, but, when I make the .apk file, the notifications arrive with a huge delay, and I want them to be precise. I read this in the docs: From https://docs.expo.dev/versions/latest/sdk/notifications/#permissions Which talks about a string to add in manifest.xml file, however I do not have this file in my project.

Do you know what to do? I want my notifications to arrive with 0 - 2 s delay, while the current ones arrive after 20s.

1 Answers1

1

If you are using Expo for your React Native project, you don't need to create or modify the AndroidManifest.xml file yourself, as it's automatically generated by Expo during the build process. Instead, you can configure your notifications using the app.json file.

To ensure that your notifications arrive with minimal delay, you can try the following:

Enable background notifications by setting expo.android.enableBackgroundNotification to true in your app.json file. This will allow your app to receive notifications even when it's not in the foreground.

Set the priority property of your notification to high to ensure that it gets delivered as quickly as possible. You can do this using the priority property in the data field of your notification payload.

Here's an example of how you can configure your notifications in the app.json file:

{
  "expo": {
    ...
    "android": {
      "useNextNotificationsApi": true,
      "enableBackgroundNotification": true,
      "priority": "max"
    },
    ...
  }
}

Additionally, make sure that your server-side code is sending the notifications promptly and with the correct priority. It's also worth noting that network connectivity and other factors can affect the delivery time of notifications, so you may not always be able to achieve a 0-2 second delay.

Asad
  • 563
  • 3
  • 16