Expo Notifications: scheduleNotificationAsync not dispatching notification when the expo client is closed.

Please provide the following:

  1. SDK Version: 38.0.0
  2. Platforms(Android/iOS/web/all): Android ( I am using Physical device )

Steps:

  1. I have installed Notifications using the following command:
expo install expo-notifications
  1. After that I have imported the expo-notification, set the notification handler and schedule the notification as follows:
import * as Notifications from "expo-notifications";

Notifications.setNotificationHandler({
            handleNotification: async () => ({
                shouldShowAlert: true,
                shouldPlaySound: true,
                shouldSetBadge: false,
            }),
        });

Notifications.scheduleNotificationAsync({
                content: {
                    title: "Time's up!",
                    body: "Change sides!",
                },
                trigger: {
                    seconds: 30,
                },
            });

Issue:
This works if the application is in the foreground. How can I achieve same behavior when the expo client is closed? I am not getting any notification when the expo client is closed.

1 Like

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