Skip to content

Commit

Permalink
fix(ios): make removeAllListeners return a promise (#5526)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Mar 29, 2022
1 parent d4a0dea commit 815f71b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/CAPPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ - (void)removeListener:(CAPPluginCall *)call {

- (void)removeAllListeners:(CAPPluginCall *)call {
[self.eventListeners removeAllObjects];
[call resolve];
}

- (NSArray<CAPPluginCall *>*)getListeners:(NSString *)eventName {
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/JSExport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ internal class JSExport {
let methods = [
PluginHeaderMethod(name: "addListener", rtype: nil),
PluginHeaderMethod(name: "removeListener", rtype: nil),
PluginHeaderMethod(name: "removeAllListeners", rtype: nil),
PluginHeaderMethod(name: "removeAllListeners", rtype: "promise"),
PluginHeaderMethod(name: "checkPermissions", rtype: "promise"),
PluginHeaderMethod(name: "requestPermissions", rtype: "promise")
]
Expand Down

0 comments on commit 815f71b

Please sign in to comment.