Search code examples
androidparse-platformchannelunsubscribe

Is there any way to unsubscribe from all the parse channel in one call in Android


I am developing an android app In that everything is working fine. I just want to ask that is there any way to unsubscribe from all the parse channel in one call instead of using :

ParsePush.unsubscribeInBackground("channel1");

checked on google and parse android api didn't find any way to do that.


Solution

  • Channels information are written in the Installation class. Simply clear the "channels" column.

    ParseInstallation installation = ParseInstallation.getCurrentInstallation();
    installation.remove("channels");
    installation.saveEventually(new SaveCallback() {  // or saveInBackground
        @Override
        public void done(ParseException e) {
            // TODO: add code here
        }
    });