iOS 未收到本地预定通知

Not receiving local scheduled notifications on iOS

我的 CRNA (Expo) 应用程序为事件提醒安排了本地通知。通知已安排并在 Android 上完美接收,但不是 iOS。

我创建了一个简化的测试用例:https://github.com/nandastone/crna-expo-local-notification-test

点击 "Send Immediate Notification" 按钮调用 Notifications.presentLocalNotificationAsync() 然后由回调接收。

点击 "Send Delayed Notification" 按钮会在 5 秒内安排 Notifications.scheduleLocalNotificationAsync() 通知,回调未收到该通知。

我知道如果应用程序在前台 (https://forums.expo.io/t/psa-reminder-notifications-in-ios-foregrounded-apps/641),iOS 不会显示通知,但我在 Notifications.addListener() 中根本收不到通知] 打回来。安排通知后关闭应用程序也没有任何效果。

我相当确定本地通知不需要 Permissions.REMOTE_NOTIFICATIONS 检查(它肯定不在 Android 上),但我已经包含它以确保。

请帮忙!

在我简化的测试用例中,我缺少用于接收通知的事件侦听器 (Notification.addListener())。

然而,我的真实应用程序中的问题是 limit of 64 local notifications on iOS。该应用同时安排了超过 64 个通知,但它们并未全部触发。