-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove all listeners for a plugin #185
base: main
Are you sure you want to change the base?
Conversation
Is there any documentation on how to use events on a Capacitor Electron plugin? |
@matallui You can find a small example in the |
@hampoelz thanks! I have something similar but it's not working.
It sounds like the above example would let you do something like this, from the client code:
But the last two lines won't work because those methods are not implemented on the plugin. I also don't understand what this means from the example:
Where do I access Any help is much appreciated! |
@matallui your code looks good to me. If you're using Capacitor with the bundled Capacitor-Core you can access your plugin with (I'm using |
@hampoelz thanks! I actually got it working by simply type casting the plugin to
This is what is working for me right now. I guess those methods are added at runtime, so Typescript was not letting me access methods that were not defined by the plugin. At least that's my take on this. |
Match
removeAllListeners()
function with Capacitor API to remove all listeners of a plugin.Refs #137