How can I disable Pushy in Capacitor using Ionic Toggle?


Is there a way to disable Pushy, in Capacitor, using Ionic Toggle? There are no function in the pushy documentation:

The goal is to have a toggle switch for enabling/disabling Pushy.

Something similar this?

async pushyToggle() {
   if (isPush == true) {
     await enablePushy();
   else if () {
     await disablePushy();

I think I might be doing it all wrong. Need help. Thanks!


You can call Pushy.unregister() to stop the device from receiving notifications, as mentioned in the Pushy Android SDK docs and Pushy iOS SDK docs. This method is also supported in the Pushy Cordova SDK which Capacitor support depends on.

Invoke this method to unregister the device from receiving notifications. Calling Pushy.register() on the device in the future will (in most cases) restore the device token which was previously assigned to the device.

Full disclosure: I work at Pushy.

Answered By – Elad Nava

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published