From fb97d0672706e5d68e443ac7aed02d79e7e73e28 Mon Sep 17 00:00:00 2001 From: JohanVase Date: Thu, 24 Oct 2019 16:21:16 +0200 Subject: [PATCH] fix(ios): event listener is not retained if was removed and added again (#2095) --- ios/Capacitor/Capacitor/CAPPlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Capacitor/Capacitor/CAPPlugin.m b/ios/Capacitor/Capacitor/CAPPlugin.m index e3e1d202b3..5ec22f618b 100644 --- a/ios/Capacitor/Capacitor/CAPPlugin.m +++ b/ios/Capacitor/Capacitor/CAPPlugin.m @@ -93,7 +93,7 @@ - (void)notifyListeners:(NSString *)eventName data:(NSDictionary - (void)notifyListeners:(NSString *)eventName data:(NSDictionary *)data retainUntilConsumed:(BOOL)retain { NSArray *listenersForEvent = [self.eventListeners objectForKey:eventName]; - if(listenersForEvent == nil) { + if(listenersForEvent == nil || [listenersForEvent count] == 0) { if (retain == YES) { [self.retainedEventArguments setObject:data forKey:eventName]; }