Not receiving local scheduled notifications on iOS

#1

My 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 based on the CRNA app: 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 (PSA/Reminder: Notifications in iOS foregrounded apps), 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!

#2

I also face the same problem. It works in Android.

#3

Hi. Thanks for the bug report and the repro.

I just cloned your example and noticed that you didn’t add a listener at all for Notification.addListener while you had one defined (_handleNotification). I added a listener and tried it both locally and on Snack. The listener is getting called in both cases.

Here is the code I ran - https://snack.expo.io/SyChaK8Hb

Let me know if you are still facing the issue with this code?

1 Like
#4

Thanks @satya164 for the response. In my case, the problem was with Permissions. I didn’t had the code for Permissions.askAsync(Permissions.NOTIFICATIONS). Once I added that it started working in iOS.

#5

Thanks, that was indeed the issue with that test case. I reduced it too much!

The issue in my real app was the limit of 64 local notifications in iOS, I was scheduling more than that and not receiving them all, a gotcha for new iOS developers like me.