katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate notification on IOS when using cordova-plugin-fcm-with-dependecy-updated

luisVargasGu opened this issue · comments

Provide a general summary of the issue.

When using cordova-plugin-local-notification to display foreground notifications in the notification bar there is an issue with IOS. There seem to be multiple payloads for a single notification. I was using the wasTapped variable in order to check whether to show a foreground notification with the other plugin but the extra payloads seem to also have that variable both true and false, so there is a duplicate notification whenever you tap on a notification. Even If the expected is 9 the back to back firebase notifications from the third notification payload is triggering an extra local notification to be sent when the notification is tapped from background.

Your Environment

  • Plugin version: timkellypa/cordova-plugin-local-notifications 0.9.0-beta.4
  • Platform: IOS
  • OS version: Mac BigSur
  • Cordova version: 10.0.0
  • Cordova platform version: cordova IOS 6.2
  • Plugin config

Expected Behavior

I sent three notification payloads for testing, and only expect three payloads to be added to the array.

Actual Behavior

This is a screenshot of an array I'm using to keep track of the payloads that are recieved within the .onNotification(function (payload) { block

119698647-715b3b00-be1f-11eb-98aa-cf81667600ed

Context

Trying to use local notifications to send notifications when the app is in the foreground as the cordova-plugin-fcm-with-dependecy-updated plugin does not provide that functionality.