social.plus SDK provides comprehensive community discovery features enabling users to explore and find relevant communities through flexible querying and search capabilities. Build powerful community exploration experiences with real-time filtering, membership-based queries, and intelligent sorting options.

Browse All Communities

Query communities with advanced filtering and sorting options

Search Communities

Find specific communities using keyword-based search

Membership Filtering

Filter by user membership status and community access

Category Organization

Organize discovery by community categories and topics

Filter Options

Membership Status Filtering

Control community discovery based on the current user’s membership status:
Filter OptionDescriptionUse Case
ALLShows all available communitiesGeneral browsing and discovery
MEMBERShows only communities the user has joinedManaging user’s communities
NOT_MEMBERShows communities the user hasn’t joinedFinding new communities to join

Sorting Options

Organize community results to match your app’s discovery flow:
Sort OptionDescriptionBest For
DISPLAY_NAMEAlphabetical order by community nameDirectory-style browsing
LAST_CREATEDNewest communities firstDiscovering fresh content
FIRST_CREATEDOldest communities firstEstablished community discovery

Category Filtering

Communities can be organized by categories to help users find relevant content faster. When a categoryId is specified, results are filtered to only include communities belonging to that category.
Combine multiple filters for precise discovery experiences. For example, search for “gaming” communities that the user is not yet a member of, sorted by creation date.

Query Communities

The getCommunities() method enables users to discover and explore communities with flexible filtering and sorting options. Perfect for building community browsing experiences, onboarding flows, and helping users find relevant communities within your app.
Query results are returned as Live Collections that automatically update when communities are added, modified, or removed, ensuring your app stays current with community changes.

Parameters

ParameterTypeDescription
filterEnumFilter by membership status: .all, .member, .notMember (default: .all)
sortByEnumSort order: .displayName, .lastCreated, .firstCreated (default: .lastCreated)
categoryIdStringFilter communities by specific category ID
includeDeletedBooleanInclude deleted communities in results (default: false)
The displayName filter parameter is deprecated. Use the search functionality with keywords for name-based filtering instead.
var token: AmityNotificationToken?

func queryCommunitiesExample() {
    let queryOptions = AmityCommunityQueryOptions(
        filter: .all, 
        sortBy: .lastCreated, 
        categoryId: nil, 
        includeDeleted: false
    )
    
    let liveCollection = communityRepository.getCommunities(with: queryOptions)
    token = liveCollection.observe { collection, change, error in
        if let error = error {
            print("Error querying communities: \(error)")
            return
        }
        
        for community in collection.allObjects() {
            // Handle each community in the results
            print("Community: \(community.displayName)")
        }
    }
}

Search Communities

The searchCommunities() method provides keyword-based community search with the same filtering and sorting capabilities as general queries. Ideal for implementing search bars and helping users find specific communities by name or related terms.

Parameters

ParameterTypeDescription
keywordStringSearch term to match against community display names
filterEnumFilter by membership status: .all, .member, .notMember (default: .all)
sortByEnumSort order: .displayName, .lastCreated, .firstCreated (default: .lastCreated)
categoryIdStringFilter search results by specific category ID
includeDeletedBooleanInclude deleted communities in search results (default: false)
If no keyword is provided, the search will return all communities sorted by the specified criteria, similar to the general query functionality.
var searchCommunitiesToken: AmityNotificationToken?

func searchCommunitiesExample() {
    let searchOptions = AmityCommunitySearchOptions(keyword: "search-keyword", filter: .all, sortBy: .lastCreated, categoryId: nil, includeDeleted: false)
    let liveCollection = communityRepository.searchCommunities(with: searchOptions)
    searchCommunitiesToken = liveCollection.observe { collection, change, error in
        for community in collection.allObjects() {
            // For example, to handle each community in the list.
        }
    }
}