Skip to content

Commit

Permalink
fix(ios): add missing listeningState stopped cases (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jun 7, 2024
1 parent 77d89b8 commit 19f98d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/Plugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class SpeechRecognition: CAPPlugin {
if result!.isFinal {
self.audioEngine!.stop()
self.audioEngine?.inputNode.removeTap(onBus: 0)
self.notifyListeners("listeningState", data: ["status": "stopped"])
self.recognitionTask = nil
self.recognitionRequest = nil
}
Expand All @@ -111,7 +112,7 @@ public class SpeechRecognition: CAPPlugin {
self.audioEngine?.inputNode.removeTap(onBus: 0)
self.recognitionRequest = nil
self.recognitionTask = nil

self.notifyListeners("listeningState", data: ["status": "stopped"])
call.reject(error!.localizedDescription)
}
})
Expand Down

0 comments on commit 19f98d1

Please sign in to comment.