react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

IOS:: Getting duplicate notification popups for single event using FCM

Open archana-iron opened this issue 7 years ago • 9 comments

Issue Description:: I am getting double notification popups inside my app when sending a single notification using FCM. I comes after I am login logout multiple times, or reinstall the app. On first login it works fine, after making these cases again and again, it sends double notification popups for single event.

I am only getting this on IOS devices. I have checked this on IOS: 10, 11, and 12 Why I am getting double popups for single event, is there any method to resolve this. For IOS I have just installed pod, and added a function to open the notification popup.

let notificationHandler = new NotificationsHandler();
this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
	notificationHandler.handleNotification(notificationOpen.notification);
});

Environment:: Binaries: Node: 10.15.0 - /usr/local/opt/node@10/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/opt/node@10/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman npmPackages: react: ^16.8.2 => 16.8.3 react-native: ^0.58.5 => 0.58.5 react-native-firebase: 5.2.3 npmGlobalPackages: react-native-cli: 2.0.1

How I can resolve this problem?

archana-iron avatar Mar 07 '19 06:03 archana-iron

I am facing same issue. Any solution you got @archana-iron

pmemids avatar Mar 15 '19 09:03 pmemids

@pmemids I have not unsubscribe from listener. That was the issue for me. I have resolved using this method. You have to unsubscribe from your listener when the component will unmount. If you don't do that you are subscribing two listeners.

componentWillUnmount() { this.notificationListener(); // it's unsubscribing your listener }

archana-iron avatar Mar 27 '19 09:03 archana-iron

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 24 '19 09:04 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar May 09 '19 09:05 stale[bot]

Yes I am also getting duplicate notifications on both android and ios

sagarguhe avatar Jun 05 '19 07:06 sagarguhe

This is a closed issue with provided resolution, there will most likely not be further discussion here

mikehardy avatar Jun 05 '19 15:06 mikehardy

Yes I am also getting duplicate notifications on both android and ios "react": "16.8.3", "react-native": "0.59.1", "react-native-firebase": "5.4.2",

vipindhangar1107 avatar Sep 25 '19 11:09 vipindhangar1107

Still struggling with same issue at this time. "react": "16.9.0", "react-native": "0.61.4", "react-native-firebase": "5.6.0",

vipindhangar1107 avatar Mar 17 '20 09:03 vipindhangar1107

can anyone help me to solve this issue in both platform Android, iOS

react-native - 0.61.5 @react-native-firebase/app - ^7.1.4 @react-native-firebase/messaging - ^7.1.6

pragneshpj avatar Jul 22 '20 10:07 pragneshpj