My CRNA (Expo) app schedules local notifications for event reminders. The notifications are scheduled and received perfectly on Android, but not iOS.
I've created a reduced test case: https://github.com/nandastone/crna-expo-local-notification-test
Tapping the "Send Immediate Notification" button calls Notifications.presentLocalNotificationAsync()
which IS then received by the callback.
Tapping the "Send Delayed Notification" button schedules a notification in 5 seconds with Notifications.scheduleLocalNotificationAsync()
which IS NOT received by the callback.
I'm aware that notifications are not displayed by iOS if the app is in the foreground (https://forums.expo.io/t/psa-reminder-notifications-in-ios-foregrounded-apps/641), but I'm not receiving notifications at all in the Notifications.addListener()
callback. Closing the app after scheduling a notification also has no effect.
I'm fairly certain the Permissions.REMOTE_NOTIFICATIONS
check is not required for local notifications (it certainly isn't on Android), but I've included it to be sure.
Please help!
In my reduced test case I was missing an event listener for receiving notifications (Notification.addListener()
).
The issue in my real app, however, was the limit of 64 local notifications on iOS. The app was scheduling more than 64 notifications at once, and they were not all firing.