I'm not an expert on telephone calls, but why don't you just call the method directly and not use listeners?
eg
function keyboardShown() { alert("test");
and
appView.sendJavascript("keyboardShown();")
In this way, you delete the service data that the listener has.
If this does not yet satisfy your telephone expert, ask him what he will do to improve this code.
source share