expo-notifications version 0.9.0 notificationReceivedListener firing multiple times in ios

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on. expo-notifications

I am using expo sdk 40 but have installed expo-notifications separately via npm to get the latest version (0.9.0)

Current behavior:

addNotificationReceivedListener firing multiple times (4 times at my end) in IOS. For android it works fine

Expected behavior:

fire once

When you add the create the event listener, is it wrapped in a useEffect?

Yes just like official documentation sample

export default function App() {

  const notificationListener = useRef();

  useEffect(() => {
   
    notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
      console.log(notification)
    });

    return () => {
      Notifications.removeNotificationSubscription(notificationListener);
    };
  }, []);