Skip to content

Commit 815f71b

Browse files
authored
fix(ios): make removeAllListeners return a promise (#5526)
1 parent d4a0dea commit 815f71b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ios/Capacitor/Capacitor/CAPPlugin.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ - (void)removeListener:(CAPPluginCall *)call {
109109

110110
- (void)removeAllListeners:(CAPPluginCall *)call {
111111
[self.eventListeners removeAllObjects];
112+
[call resolve];
112113
}
113114

114115
- (NSArray<CAPPluginCall *>*)getListeners:(NSString *)eventName {

ios/Capacitor/Capacitor/JSExport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ internal class JSExport {
9797
let methods = [
9898
PluginHeaderMethod(name: "addListener", rtype: nil),
9999
PluginHeaderMethod(name: "removeListener", rtype: nil),
100-
PluginHeaderMethod(name: "removeAllListeners", rtype: nil),
100+
PluginHeaderMethod(name: "removeAllListeners", rtype: "promise"),
101101
PluginHeaderMethod(name: "checkPermissions", rtype: "promise"),
102102
PluginHeaderMethod(name: "requestPermissions", rtype: "promise")
103103
]

0 commit comments

Comments
 (0)