Pre-Requisites
- Integration of iOS SDK
- Configure preference categories on SuprSend dashboard
Understanding preference structure
This is how a typical preference page will look like:
- Category-level preference settings (Sections)
- Overall Channel-level preference

Preferences data structure
1.1 Sections
This contains the name, description, and subcategories. We have to loop through the sections list and for every section item if there is a name and description present, then show the heading, and if a subcategories list is present, loop through that subcategories list and show all subcategories under that section heading. Subcategories can exist without sections as the section is an optional field. In that case, the section’s name will not be available. For sections where the name is not present, you can directly show its subcategories list without showing Heading for the section in UI.
1.2 Categories (sections -> sub-categories)
This is the place where the user sets his category-level preferences. While looping through the subcategories list for every subcategory item, show the name and description in UI.
1.3 Category channels (sections -> sub-categories -> channels)
This contains a list of channels, channel preference status and whether it’s editable or not. While looping through the subcategory list for every subcategory item we have to loop through its channels list and for every channel to show channel level checkbox.
2. Overall channel preferences
It’s a list of all channel-level preferences. We have to loop through the list and for each item, show the UI as given in the below image.
Integration
Get preferences data
Use this method to get preferences data and create the preferences UI by following the above sections. This method should be called first before any update preference methods.
Returns:
async -> PreferenceAPIResponse
Update channel preference in category
Calling this method will opt-in/opt-out users from that category-level channel. When the category’s channel checkbox is editable and the user clicks on the checkbox you can call this method.async -> PreferenceAPIResponse

Update category preference
This is category level preference changing method. Calling this method will opt-in/opt-out user from that category. When the category is editable and the switch is toggled you can call this method.async -> PreferenceAPIResponse
Update overall channel preference
This method updated the channel-level preference of the user.async -> PreferenceAPIResponse

