diff --git a/src/android/com/onesignal/cordova/OneSignalPush.java b/src/android/com/onesignal/cordova/OneSignalPush.java index 54f4b3a0..8817f506 100644 --- a/src/android/com/onesignal/cordova/OneSignalPush.java +++ b/src/android/com/onesignal/cordova/OneSignalPush.java @@ -236,10 +236,17 @@ private boolean preventDefault(JSONArray data) { * N O T I F I C A T I O N C L I C K L I S T E N E R */ + private boolean hasAddedNotificationClickListener = false; + public boolean addNotificationClickListener(CallbackContext callbackContext) { - OneSignal.getNotifications().addClickListener(this); - jsNotificationClickedCallback = callbackContext; - return true; + if (this.hasAddedNotificationClickListener) { + return false; + } + + OneSignal.getNotifications().addClickListener(this); + jsNotificationClickedCallback = callbackContext; + hasAddedNotificationClickListener = true; + return true; } @Override