Search code examples
androidparse-platformpush

Parse Push Channel - user can subscribe/unsubscribe


Is it possible to add a subscribe/unsubscribe to channel(s) from a menu or navigation drawer in Android?

The user can check or turn off which channels they want messages from, and then the system would update. Are there any tutorials that Parse has provided?

My app will have two different locations: Location 1 and Location 2. I'd like to associate a channel with each location and have users be able to subscribe / unsubscribe to each location independently.


Solution

  • Yes, Parse provides an interface to do this via their documentation

    To subscribe to a channel:

    ParsePush.subscribeInBackground("Giants");
    

    And to unsubscribe to a channel:

    ParsePush.unsubscribeInBackground("Giants");
    

    To trigger this, just use the setOnItemClickListener found in Android. This question on SO may be a good starting point.