Skip to content

Commit

Permalink
fix(ios): properly deliver retained events after listener re-add #5732
Browse files Browse the repository at this point in the history
  • Loading branch information
theproducer authored Jul 1, 2022
1 parent 24140ae commit c5d6328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ -(void)load {}

- (void)addEventListener:(NSString *)eventName listener:(CAPPluginCall *)listener {
NSMutableArray *listenersForEvent = [self.eventListeners objectForKey:eventName];
if(!listenersForEvent) {
if(listenersForEvent == nil || [listenersForEvent count] == 0) {
listenersForEvent = [[NSMutableArray alloc] initWithObjects:listener, nil];
[self.eventListeners setValue:listenersForEvent forKey:eventName];

Expand Down

0 comments on commit c5d6328

Please sign in to comment.