Issue
Is there a way to disable Pushy, in Capacitor, using Ionic Toggle? There are no function in the pushy documentation: https://pushy.me/docs/additional-platforms/capacitor
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!
Solution
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
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.