Reliable local notifications

Please provide the following:

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): android (for now, ios soon)

In my app I need to ensure reliable local notifications. Notifications are an importand part of the app and the cell network in germany is not reliable enough to ensure they are all yielded as planned.

Now I got first feedback of my users that the local notifications worked first, but now:

  • dont appear
  • or appear unreliable and and later than planned, e.g. not at 15:00 but at 16:40 when the smartphone is used again

So I wonder, how could I implement reliable local notifications with expo-notifications?
What config-, initialization- or usage-tweaks would make them more reliable?
Are there system-settings I shoud check in app code to ensure, my app is able to yield local notifications as planned?

Excerpts from my code:

app.config.js

...
android: {
  ...
  permissions: [],
  useNextNotificationsApi: true,
},

Application code

// before anything else with notifications, I ask for permission
const askPermissions = async () => {
  const { status: existingStatus } = await Notifications.getPermissionsAsync();
  let finalStatus = existingStatus;
  if (existingStatus !== 'granted') {
    const { status } = await Notifications.requestPermissionsAsync();
    finalStatus = status;
  }
  if (finalStatus !== 'granted') {
    return false;
  }
  return true;
};
await askPermissions().then(async(result) => {
  if (result) {
      Notifications.setNotificationHandler({
        handleNotification: async () => ({
          shouldShowAlert: true,
          shouldPlaySound: true,
          shouldSetBadge: true,
        }),
      });
      // For-Of loop over all required notifications
      const notification = Notifications.scheduleNotificationAsync({
              content: {
                title: "Reminder Title",
                data: {
                  id: notification.id,
                  ...
                },
              },
              identifier: `Reminder:${reminder.id}`,
              trigger: notification.time.toDate(), // dayjs object to vanilla date object
            });
            notificationsScheduling.push(notification as Promise<`Reminder:${number}`>);
         // End registering notifications
        await Promise.all(notificationsScheduling);
  }
})

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