No idea about javascript. Never used. Open Appium github and look for JavaScript-Client.
Regarding listners. You are talking about some your app. Appium does not care how messagers working inside any private app. All you can do is send some event to device in a way your accept. To move further and start from something - did you manage to send such events to your app manually first? I believe it is also a platform specific e.g. in Android one way in iOS should be another one.