- SDK Version: 40
- Platforms(Android/iOS/web/all): iOS
- 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);
};
}, []);
system
Closed
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.