Community categories enable organized discovery and management of communities by grouping them into logical classifications. When communities are placed into categories, users can easily sort and filter communities based on their category, allowing for more efficient and effective community management.

Category Discovery

Query all available community categories with sorting options

Flexible Sorting

Sort by creation date, alphabetical order, or custom criteria

Deletion Management

Include or exclude deleted categories from query results

Live Collections

Real-time updates when categories are modified

Category Query

The getCategories() function retrieves all available community categories with flexible sorting and filtering options. This method returns a Live Collection that automatically updates when categories are modified.

Parameters

ParameterTypeRequiredDescription
sortByEnumNoSort order for categories
includeDeletedBooleanNoInclude deleted categories in results

Sort Options

OptionDescription
displayNameAlphabetical order by category name
firstCreatedOldest categories first
lastCreatedNewest categories first
var token: AmityNotificationToken?

func getCategoriesExample() {
    let liveCollection = communityRepository.getCategories(
        sortBy: .displayName,
        includeDeleted: true
    )
    token = liveCollection.observe { collection, change, error in
        for category in collection.allObjects() {
            // Handle each category in the list
        }
    }
}

User Experience

Category Display

  • Show category names clearly in navigation
  • Display community counts per category
  • Provide search/filter within categories

Navigation Design

  • Use categories for intuitive community browsing
  • Implement breadcrumb navigation
  • Allow quick category switching

Common Use Cases

Community Organization

  • Create category-based navigation menus
  • Filter communities by topic or interest
  • Build hierarchical community structures

Discovery Enhancement

  • Implement category-based search filters
  • Create topic-specific community recommendations
  • Build category landing pages

Administrative Tools

  • Track community distribution across categories
  • Monitor category usage and popularity
  • Manage category-based permissions